3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
14 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
28 #define DL_IMPORT(t) t
31 #define DL_EXPORT(t) t
34 #ifndef HAVE_LONG_LONG
35 #if PY_VERSION_HEX >= 0x02070000
36 #define HAVE_LONG_LONG
40 #define PY_LONG_LONG LONG_LONG
43 #define Py_HUGE_VAL HUGE_VAL
46 #define CYTHON_COMPILING_IN_PYPY 1
47 #define CYTHON_COMPILING_IN_PYSTON 0
48 #define CYTHON_COMPILING_IN_CPYTHON 0
49 #undef CYTHON_USE_TYPE_SLOTS
50 #define CYTHON_USE_TYPE_SLOTS 0
51 #undef CYTHON_USE_PYTYPE_LOOKUP
52 #define CYTHON_USE_PYTYPE_LOOKUP 0
53 #if PY_VERSION_HEX < 0x03050000
54 #undef CYTHON_USE_ASYNC_SLOTS
55 #define CYTHON_USE_ASYNC_SLOTS 0
56 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57 #define CYTHON_USE_ASYNC_SLOTS 1
59 #undef CYTHON_USE_PYLIST_INTERNALS
60 #define CYTHON_USE_PYLIST_INTERNALS 0
61 #undef CYTHON_USE_UNICODE_INTERNALS
62 #define CYTHON_USE_UNICODE_INTERNALS 0
63 #undef CYTHON_USE_UNICODE_WRITER
64 #define CYTHON_USE_UNICODE_WRITER 0
65 #undef CYTHON_USE_PYLONG_INTERNALS
66 #define CYTHON_USE_PYLONG_INTERNALS 0
67 #undef CYTHON_AVOID_BORROWED_REFS
68 #define CYTHON_AVOID_BORROWED_REFS 1
69 #undef CYTHON_ASSUME_SAFE_MACROS
70 #define CYTHON_ASSUME_SAFE_MACROS 0
71 #undef CYTHON_UNPACK_METHODS
72 #define CYTHON_UNPACK_METHODS 0
73 #undef CYTHON_FAST_THREAD_STATE
74 #define CYTHON_FAST_THREAD_STATE 0
75 #undef CYTHON_FAST_PYCALL
76 #define CYTHON_FAST_PYCALL 0
77 #undef CYTHON_PEP489_MULTI_PHASE_INIT
78 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79 #undef CYTHON_USE_TP_FINALIZE
80 #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82 #define CYTHON_COMPILING_IN_PYPY 0
83 #define CYTHON_COMPILING_IN_PYSTON 1
84 #define CYTHON_COMPILING_IN_CPYTHON 0
85 #ifndef CYTHON_USE_TYPE_SLOTS
86 #define CYTHON_USE_TYPE_SLOTS 1
88 #undef CYTHON_USE_PYTYPE_LOOKUP
89 #define CYTHON_USE_PYTYPE_LOOKUP 0
90 #undef CYTHON_USE_ASYNC_SLOTS
91 #define CYTHON_USE_ASYNC_SLOTS 0
92 #undef CYTHON_USE_PYLIST_INTERNALS
93 #define CYTHON_USE_PYLIST_INTERNALS 0
94 #ifndef CYTHON_USE_UNICODE_INTERNALS
95 #define CYTHON_USE_UNICODE_INTERNALS 1
97 #undef CYTHON_USE_UNICODE_WRITER
98 #define CYTHON_USE_UNICODE_WRITER 0
99 #undef CYTHON_USE_PYLONG_INTERNALS
100 #define CYTHON_USE_PYLONG_INTERNALS 0
101 #ifndef CYTHON_AVOID_BORROWED_REFS
102 #define CYTHON_AVOID_BORROWED_REFS 0
104 #ifndef CYTHON_ASSUME_SAFE_MACROS
105 #define CYTHON_ASSUME_SAFE_MACROS 1
107 #ifndef CYTHON_UNPACK_METHODS
108 #define CYTHON_UNPACK_METHODS 1
110 #undef CYTHON_FAST_THREAD_STATE
111 #define CYTHON_FAST_THREAD_STATE 0
112 #undef CYTHON_FAST_PYCALL
113 #define CYTHON_FAST_PYCALL 0
114 #undef CYTHON_PEP489_MULTI_PHASE_INIT
115 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116 #undef CYTHON_USE_TP_FINALIZE
117 #define CYTHON_USE_TP_FINALIZE 0
119 #define CYTHON_COMPILING_IN_PYPY 0
120 #define CYTHON_COMPILING_IN_PYSTON 0
121 #define CYTHON_COMPILING_IN_CPYTHON 1
122 #ifndef CYTHON_USE_TYPE_SLOTS
123 #define CYTHON_USE_TYPE_SLOTS 1
125 #if PY_VERSION_HEX < 0x02070000
126 #undef CYTHON_USE_PYTYPE_LOOKUP
127 #define CYTHON_USE_PYTYPE_LOOKUP 0
128 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129 #define CYTHON_USE_PYTYPE_LOOKUP 1
131 #if PY_MAJOR_VERSION < 3
132 #undef CYTHON_USE_ASYNC_SLOTS
133 #define CYTHON_USE_ASYNC_SLOTS 0
134 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135 #define CYTHON_USE_ASYNC_SLOTS 1
137 #if PY_VERSION_HEX < 0x02070000
138 #undef CYTHON_USE_PYLONG_INTERNALS
139 #define CYTHON_USE_PYLONG_INTERNALS 0
140 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141 #define CYTHON_USE_PYLONG_INTERNALS 1
143 #ifndef CYTHON_USE_PYLIST_INTERNALS
144 #define CYTHON_USE_PYLIST_INTERNALS 1
146 #ifndef CYTHON_USE_UNICODE_INTERNALS
147 #define CYTHON_USE_UNICODE_INTERNALS 1
149 #if PY_VERSION_HEX < 0x030300F0
150 #undef CYTHON_USE_UNICODE_WRITER
151 #define CYTHON_USE_UNICODE_WRITER 0
152 #elif !defined(CYTHON_USE_UNICODE_WRITER)
153 #define CYTHON_USE_UNICODE_WRITER 1
155 #ifndef CYTHON_AVOID_BORROWED_REFS
156 #define CYTHON_AVOID_BORROWED_REFS 0
158 #ifndef CYTHON_ASSUME_SAFE_MACROS
159 #define CYTHON_ASSUME_SAFE_MACROS 1
161 #ifndef CYTHON_UNPACK_METHODS
162 #define CYTHON_UNPACK_METHODS 1
164 #ifndef CYTHON_FAST_THREAD_STATE
165 #define CYTHON_FAST_THREAD_STATE 1
167 #ifndef CYTHON_FAST_PYCALL
168 #define CYTHON_FAST_PYCALL 1
170 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
173 #ifndef CYTHON_USE_TP_FINALIZE
174 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
180 #if CYTHON_USE_PYLONG_INTERNALS
181 #include "longintrepr.h"
186 #ifndef __has_attribute
187 #define __has_attribute(x) 0
189 #ifndef __has_cpp_attribute
190 #define __has_cpp_attribute(x) 0
192 #ifndef CYTHON_RESTRICT
193 #if defined(__GNUC__)
194 #define CYTHON_RESTRICT __restrict__
195 #elif defined(_MSC_VER) && _MSC_VER >= 1400
196 #define CYTHON_RESTRICT __restrict
197 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198 #define CYTHON_RESTRICT restrict
200 #define CYTHON_RESTRICT
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
208 # define CYTHON_UNUSED
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
213 # define CYTHON_UNUSED
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
232 #ifndef _MSC_STDINT_H_
234 typedef unsigned char uint8_t;
235 typedef unsigned int uint32_t;
237 typedef unsigned __int8 uint8_t;
238 typedef unsigned __int32 uint32_t;
244 #ifndef CYTHON_FALLTHROUGH
245 #if defined(__cplusplus) && __cplusplus >= 201103L
246 #if __has_cpp_attribute(fallthrough)
247 #define CYTHON_FALLTHROUGH [[fallthrough]]
248 #elif __has_cpp_attribute(clang::fallthrough)
249 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250 #elif __has_cpp_attribute(gnu::fallthrough)
251 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
254 #ifndef CYTHON_FALLTHROUGH
255 #if __has_attribute(fallthrough)
256 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
258 #define CYTHON_FALLTHROUGH
261 #if defined(__clang__ ) && defined(__apple_build_version__)
262 #if __apple_build_version__ < 7000000
263 #undef CYTHON_FALLTHROUGH
264 #define CYTHON_FALLTHROUGH
269 #ifndef CYTHON_INLINE
270 #if defined(__clang__)
271 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272 #elif defined(__GNUC__)
273 #define CYTHON_INLINE __inline__
274 #elif defined(_MSC_VER)
275 #define CYTHON_INLINE __inline
276 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277 #define CYTHON_INLINE inline
279 #define CYTHON_INLINE
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284 #define Py_OptimizeFlag 0
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292 #define __Pyx_DefaultClassType PyClass_Type
294 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297 #define __Pyx_DefaultClassType PyType_Type
299 #ifndef Py_TPFLAGS_CHECKTYPES
300 #define Py_TPFLAGS_CHECKTYPES 0
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303 #define Py_TPFLAGS_HAVE_INDEX 0
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309 #define Py_TPFLAGS_HAVE_FINALIZE 0
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312 #ifndef METH_FASTCALL
313 #define METH_FASTCALL 0x80
315 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
316 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
317 Py_ssize_t nargs, PyObject *kwnames);
319 #define __Pyx_PyCFunctionFast _PyCFunctionFast
320 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
326 #define __Pyx_PyFastCFunction_Check(func) 0
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329 #define PyObject_Malloc(s) PyMem_Malloc(s)
330 #define PyObject_Free(p) PyMem_Free(p)
331 #define PyObject_Realloc(p) PyMem_Realloc(p)
333 #if CYTHON_COMPILING_IN_PYSTON
334 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
337 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341 #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345 #define __Pyx_PyThreadState_Current PyThreadState_GET()
347 #define __Pyx_PyThreadState_Current _PyThreadState_Current
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
354 *key = PyThread_create_key();
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
358 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
359 *key = Py_tss_NEEDS_INIT;
362 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
365 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
366 return *key != Py_tss_NEEDS_INIT;
368 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
369 PyThread_delete_key(*key);
370 *key = Py_tss_NEEDS_INIT;
372 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
373 return PyThread_set_key_value(*key, value);
375 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
376 return PyThread_get_key_value(*key);
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
388 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397 #define CYTHON_PEP393_ENABLED 1
398 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399 0 : _PyUnicode_Ready((PyObject *)(op)))
400 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
409 #define CYTHON_PEP393_ENABLED 0
410 #define PyUnicode_1BYTE_KIND 1
411 #define PyUnicode_2BYTE_KIND 2
412 #define PyUnicode_4BYTE_KIND 4
413 #define __Pyx_PyUnicode_READY(op) (0)
414 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
423 #if CYTHON_COMPILING_IN_PYPY
424 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
427 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
445 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448 #define PyObject_ASCII(o) PyObject_Repr(o)
450 #if PY_MAJOR_VERSION >= 3
451 #define PyBaseString_Type PyUnicode_Type
452 #define PyStringObject PyUnicodeObject
453 #define PyString_Type PyUnicode_Type
454 #define PyString_Check PyUnicode_Check
455 #define PyString_CheckExact PyUnicode_CheckExact
456 #define PyObject_Unicode PyObject_Str
458 #if PY_MAJOR_VERSION >= 3
459 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
462 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
465 #ifndef PySet_CheckExact
466 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
468 #if CYTHON_ASSUME_SAFE_MACROS
469 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
471 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
473 #if PY_MAJOR_VERSION >= 3
474 #define PyIntObject PyLongObject
475 #define PyInt_Type PyLong_Type
476 #define PyInt_Check(op) PyLong_Check(op)
477 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478 #define PyInt_FromString PyLong_FromString
479 #define PyInt_FromUnicode PyLong_FromUnicode
480 #define PyInt_FromLong PyLong_FromLong
481 #define PyInt_FromSize_t PyLong_FromSize_t
482 #define PyInt_FromSsize_t PyLong_FromSsize_t
483 #define PyInt_AsLong PyLong_AsLong
484 #define PyInt_AS_LONG PyLong_AS_LONG
485 #define PyInt_AsSsize_t PyLong_AsSsize_t
486 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488 #define PyNumber_Int PyNumber_Long
490 #if PY_MAJOR_VERSION >= 3
491 #define PyBoolObject PyLongObject
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494 #ifndef PyUnicode_InternFromString
495 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
498 #if PY_VERSION_HEX < 0x030200A4
499 typedef long Py_hash_t;
500 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
503 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
506 #if PY_MAJOR_VERSION >= 3
507 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
509 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
511 #if CYTHON_USE_ASYNC_SLOTS
512 #if PY_VERSION_HEX >= 0x030500B1
513 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
516 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
519 #define __Pyx_PyType_AsAsync(obj) NULL
521 #ifndef __Pyx_PyAsyncMethodsStruct
526 } __Pyx_PyAsyncMethodsStruct;
529 #if defined(WIN32) || defined(MS_WINDOWS)
530 #define _USE_MATH_DEFINES
534 #define __PYX_NAN() ((float) NAN)
536 static CYTHON_INLINE
float __PYX_NAN() {
538 memset(&value, 0xFF,
sizeof(value));
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
545 #define __Pyx_truncl truncl
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
551 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
554 #ifndef __PYX_EXTERN_C
556 #define __PYX_EXTERN_C extern "C"
558 #define __PYX_EXTERN_C extern
562 #define __PYX_HAVE__subsurfaceTransportFunctions
563 #define __PYX_HAVE_API__subsurfaceTransportFunctions
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
575 #define CYTHON_WITHOUT_ASSERTIONS
578 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
579 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
581 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
582 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
583 #define __PYX_DEFAULT_STRING_ENCODING ""
584 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
585 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
586 #define __Pyx_uchar_cast(c) ((unsigned char)c)
587 #define __Pyx_long_cast(x) ((long)x)
588 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
589 (sizeof(type) < sizeof(Py_ssize_t)) ||\
590 (sizeof(type) > sizeof(Py_ssize_t) &&\
591 likely(v < (type)PY_SSIZE_T_MAX ||\
592 v == (type)PY_SSIZE_T_MAX) &&\
593 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
594 v == (type)PY_SSIZE_T_MIN))) ||\
595 (sizeof(type) == sizeof(Py_ssize_t) &&\
596 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
597 v == (type)PY_SSIZE_T_MAX))) )
598 #if defined (__cplusplus) && __cplusplus >= 201103L
600 #define __Pyx_sst_abs(value) std::abs(value)
601 #elif SIZEOF_INT >= SIZEOF_SIZE_T
602 #define __Pyx_sst_abs(value) abs(value)
603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
604 #define __Pyx_sst_abs(value) labs(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
608 #define __Pyx_sst_abs(value) llabs(value)
609 #elif defined (__GNUC__)
610 #define __Pyx_sst_abs(value) __builtin_llabs(value)
612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
614 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
618 #define __Pyx_PyBytes_FromString PyBytes_FromString
619 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
620 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
621 #if PY_MAJOR_VERSION < 3
622 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
623 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
644 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
645 const Py_UNICODE *u_end =
u;
647 return (
size_t)(u_end -
u - 1);
649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
655 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
661 #if CYTHON_ASSUME_SAFE_MACROS
662 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
664 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
666 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
667 #if PY_MAJOR_VERSION >= 3
668 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
670 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
672 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
673 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
674 static int __Pyx_sys_getdefaultencoding_not_ascii;
675 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
677 PyObject* default_encoding = NULL;
678 PyObject* ascii_chars_u = NULL;
679 PyObject* ascii_chars_b = NULL;
680 const char* default_encoding_c;
681 sys = PyImport_ImportModule(
"sys");
683 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
685 if (!default_encoding)
goto bad;
686 default_encoding_c = PyBytes_AsString(default_encoding);
687 if (!default_encoding_c)
goto bad;
688 if (strcmp(default_encoding_c,
"ascii") == 0) {
689 __Pyx_sys_getdefaultencoding_not_ascii = 0;
691 char ascii_chars[128];
693 for (
c = 0;
c < 128;
c++) {
696 __Pyx_sys_getdefaultencoding_not_ascii = 1;
697 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
698 if (!ascii_chars_u)
goto bad;
699 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
700 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
703 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
707 Py_DECREF(ascii_chars_u);
708 Py_DECREF(ascii_chars_b);
710 Py_DECREF(default_encoding);
713 Py_XDECREF(default_encoding);
714 Py_XDECREF(ascii_chars_u);
715 Py_XDECREF(ascii_chars_b);
719 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
720 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
722 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
723 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
724 static char* __PYX_DEFAULT_STRING_ENCODING;
725 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
727 PyObject* default_encoding = NULL;
728 char* default_encoding_c;
729 sys = PyImport_ImportModule(
"sys");
731 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
733 if (!default_encoding)
goto bad;
734 default_encoding_c = PyBytes_AsString(default_encoding);
735 if (!default_encoding_c)
goto bad;
736 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
737 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
738 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
739 Py_DECREF(default_encoding);
742 Py_XDECREF(default_encoding);
750 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
751 #define likely(x) __builtin_expect(!!(x), 1)
752 #define unlikely(x) __builtin_expect(!!(x), 0)
754 #define likely(x) (x)
755 #define unlikely(x) (x)
757 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
759 static PyObject *__pyx_m = NULL;
760 static PyObject *__pyx_d;
761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
763 static PyObject *__pyx_empty_tuple;
764 static PyObject *__pyx_empty_bytes;
765 static PyObject *__pyx_empty_unicode;
766 static int __pyx_lineno;
767 static int __pyx_clineno = 0;
768 static const char * __pyx_cfilenm= __FILE__;
769 static const char *__pyx_filename;
772 #if !defined(CYTHON_CCOMPLEX)
773 #if defined(__cplusplus)
774 #define CYTHON_CCOMPLEX 1
775 #elif defined(_Complex_I)
776 #define CYTHON_CCOMPLEX 1
778 #define CYTHON_CCOMPLEX 0
788 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
790 #define _Complex_I 1.0fj
794 static const char *__pyx_f[] = {
795 "proteus/subsurfaceTransportFunctions.pyx",
796 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
797 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
800 #define IS_UNSIGNED(type) (((type) -1) > 0)
801 struct __Pyx_StructField_;
802 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
805 struct __Pyx_StructField_* fields;
813 typedef struct __Pyx_StructField_ {
814 __Pyx_TypeInfo* type;
819 __Pyx_StructField* field;
820 size_t parent_offset;
821 } __Pyx_BufFmt_StackElem;
823 __Pyx_StructField root;
824 __Pyx_BufFmt_StackElem* head;
826 size_t new_count, enc_count;
827 size_t struct_alignment;
833 } __Pyx_BufFmt_Context;
843 typedef npy_int8 __pyx_t_5numpy_int8_t;
852 typedef npy_int16 __pyx_t_5numpy_int16_t;
861 typedef npy_int32 __pyx_t_5numpy_int32_t;
870 typedef npy_int64 __pyx_t_5numpy_int64_t;
879 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
888 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
897 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
906 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
915 typedef npy_float32 __pyx_t_5numpy_float32_t;
924 typedef npy_float64 __pyx_t_5numpy_float64_t;
933 typedef npy_long __pyx_t_5numpy_int_t;
942 typedef npy_longlong __pyx_t_5numpy_long_t;
951 typedef npy_longlong __pyx_t_5numpy_longlong_t;
960 typedef npy_ulong __pyx_t_5numpy_uint_t;
969 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
978 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
987 typedef npy_intp __pyx_t_5numpy_intp_t;
996 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1005 typedef npy_double __pyx_t_5numpy_float_t;
1014 typedef npy_double __pyx_t_5numpy_double_t;
1023 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1032 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
1041 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
1045 typedef ::std::complex< float > __pyx_t_float_complex;
1047 typedef float _Complex __pyx_t_float_complex;
1050 typedef struct {
float real, imag; } __pyx_t_float_complex;
1052 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1057 typedef ::std::complex< double > __pyx_t_double_complex;
1059 typedef double _Complex __pyx_t_double_complex;
1062 typedef struct {
double real, imag; } __pyx_t_double_complex;
1064 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1076 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1085 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1094 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1103 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1107 #ifndef CYTHON_REFNANNY
1108 #define CYTHON_REFNANNY 0
1112 void (*INCREF)(
void*, PyObject*, int);
1113 void (*DECREF)(
void*, PyObject*, int);
1114 void (*GOTREF)(
void*, PyObject*, int);
1115 void (*GIVEREF)(
void*, PyObject*, int);
1116 void* (*SetupContext)(
const char*, int,
const char*);
1117 void (*FinishContext)(
void**);
1118 } __Pyx_RefNannyAPIStruct;
1119 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1120 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1121 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1123 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1125 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1126 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1127 PyGILState_Release(__pyx_gilstate_save);\
1129 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1132 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1133 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1135 #define __Pyx_RefNannyFinishContext()\
1136 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1137 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1138 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1139 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1140 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1141 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1142 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1143 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1144 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1146 #define __Pyx_RefNannyDeclarations
1147 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1148 #define __Pyx_RefNannyFinishContext()
1149 #define __Pyx_INCREF(r) Py_INCREF(r)
1150 #define __Pyx_DECREF(r) Py_DECREF(r)
1151 #define __Pyx_GOTREF(r)
1152 #define __Pyx_GIVEREF(r)
1153 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1154 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1155 #define __Pyx_XGOTREF(r)
1156 #define __Pyx_XGIVEREF(r)
1158 #define __Pyx_XDECREF_SET(r, v) do {\
1159 PyObject *tmp = (PyObject *) r;\
1160 r = v; __Pyx_XDECREF(tmp);\
1162 #define __Pyx_DECREF_SET(r, v) do {\
1163 PyObject *tmp = (PyObject *) r;\
1164 r = v; __Pyx_DECREF(tmp);\
1166 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1167 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1170 #if CYTHON_USE_TYPE_SLOTS
1171 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1173 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1177 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1180 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1181 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1184 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1187 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1188 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1189 const char* function_name);
1192 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1193 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1194 __Pyx__ArgTypeTest(obj, type, name, exact))
1195 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1198 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1201 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1202 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1203 __Pyx_BufFmt_StackElem* stack,
1204 __Pyx_TypeInfo* type);
1207 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1208 ((obj == Py_None || obj == NULL) ?\
1209 (__Pyx_ZeroBuffer(buf), 0) :\
1210 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1211 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1212 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1213 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1214 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1215 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1216 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1219 static void __Pyx_RaiseBufferIndexError(
int axis);
1221 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1222 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
1224 #if CYTHON_FAST_THREAD_STATE
1225 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1226 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1227 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1229 #define __Pyx_PyThreadState_declare
1230 #define __Pyx_PyThreadState_assign
1231 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1235 #if CYTHON_FAST_THREAD_STATE
1236 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1237 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1238 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1239 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1240 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1241 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1242 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1243 #if CYTHON_COMPILING_IN_CPYTHON
1244 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1246 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1249 #define __Pyx_PyErr_Clear() PyErr_Clear()
1250 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1251 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1252 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1253 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1254 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1255 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1256 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1260 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1261 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1262 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1263 (likely(PyDict_CheckExact(obj)) ?\
1264 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1266 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1267 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1270 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
1272 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1273 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1274 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1275 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1276 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1277 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1278 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1279 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1280 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1281 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1282 int wraparound,
int boundscheck);
1283 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1284 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1285 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1286 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1287 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1288 int wraparound,
int boundscheck);
1289 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1290 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1291 int is_list,
int wraparound,
int boundscheck);
1294 #if CYTHON_USE_TYPE_SLOTS
1295 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1297 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1301 #if !CYTHON_COMPILING_IN_PYPY
1302 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1304 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace)\
1305 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1308 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
1310 #if CYTHON_FAST_PYCALL
1311 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1312 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1313 #if 1 || PY_VERSION_HEX < 0x030600B1
1314 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1316 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1321 #if CYTHON_FAST_PYCCALL
1322 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1324 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1328 #if CYTHON_COMPILING_IN_CPYTHON
1329 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1331 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1335 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1338 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1341 #if CYTHON_COMPILING_IN_CPYTHON
1342 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1346 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1349 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1350 #if CYTHON_COMPILING_IN_PYPY
1351 #define __Pyx_PyObject_AsDouble(obj)\
1352 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
1353 likely(PyInt_CheckExact(obj)) ?\
1354 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
1356 #define __Pyx_PyObject_AsDouble(obj)\
1357 ((likely(PyFloat_CheckExact(obj))) ?\
1358 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
1362 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1365 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1368 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1371 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1374 #if CYTHON_FAST_THREAD_STATE
1375 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1376 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1377 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1378 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1380 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1381 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1385 #if CYTHON_FAST_THREAD_STATE
1386 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1387 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1389 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1393 #if CYTHON_FAST_THREAD_STATE
1394 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1395 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1397 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1401 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1404 #ifdef CYTHON_CLINE_IN_TRACEBACK
1405 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1407 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1412 PyCodeObject* code_object;
1414 } __Pyx_CodeObjectCacheEntry;
1415 struct __Pyx_CodeObjectCache {
1418 __Pyx_CodeObjectCacheEntry* entries;
1420 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1421 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1422 static PyCodeObject *__pyx_find_code_object(
int code_line);
1423 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1426 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1427 int py_line,
const char *filename);
1431 Py_ssize_t shape, strides, suboffsets;
1432 } __Pyx_Buf_DimInfo;
1438 __Pyx_Buffer *rcbuffer;
1440 __Pyx_Buf_DimInfo diminfo[8];
1441 } __Pyx_LocalBuf_ND;
1443 #if PY_MAJOR_VERSION < 3
1444 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1445 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1447 #define __Pyx_GetBuffer PyObject_GetBuffer
1448 #define __Pyx_ReleaseBuffer PyBuffer_Release
1453 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1456 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1459 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1464 #define __Pyx_CREAL(z) ((z).real())
1465 #define __Pyx_CIMAG(z) ((z).imag())
1467 #define __Pyx_CREAL(z) (__real__(z))
1468 #define __Pyx_CIMAG(z) (__imag__(z))
1471 #define __Pyx_CREAL(z) ((z).real)
1472 #define __Pyx_CIMAG(z) ((z).imag)
1474 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1475 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1476 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1477 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1479 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1480 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1485 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1486 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1487 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1488 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1489 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1490 #define __Pyx_c_neg_float(a) (-(a))
1492 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1493 #define __Pyx_c_conj_float(z) (::std::conj(z))
1495 #define __Pyx_c_abs_float(z) (::std::abs(z))
1496 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1499 #define __Pyx_c_is_zero_float(z) ((z)==0)
1500 #define __Pyx_c_conj_float(z) (conjf(z))
1502 #define __Pyx_c_abs_float(z) (cabsf(z))
1503 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1507 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1508 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1509 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1510 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1511 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1512 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1513 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1514 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1516 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1517 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1523 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1524 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1525 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1526 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1527 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1528 #define __Pyx_c_neg_double(a) (-(a))
1530 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1531 #define __Pyx_c_conj_double(z) (::std::conj(z))
1533 #define __Pyx_c_abs_double(z) (::std::abs(z))
1534 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1537 #define __Pyx_c_is_zero_double(z) ((z)==0)
1538 #define __Pyx_c_conj_double(z) (conj(z))
1540 #define __Pyx_c_abs_double(z) (cabs(z))
1541 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1545 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1546 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1547 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1548 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1549 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1550 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1551 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1552 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1554 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1555 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1560 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1563 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1566 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1569 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1572 #if CYTHON_COMPILING_IN_CPYTHON
1573 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1574 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1575 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1576 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1578 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1579 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1580 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1582 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1585 static int __Pyx_check_binary_version(
void);
1588 #if !defined(__Pyx_PyIdentifier_FromString)
1589 #if PY_MAJOR_VERSION < 3
1590 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
1592 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
1597 static PyObject *__Pyx_ImportModule(
const char *name);
1600 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
1603 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1615 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1628 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1629 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1630 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1631 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1632 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1633 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1636 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1637 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1638 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions"
1639 extern int __pyx_module_is_main_subsurfaceTransportFunctions;
1640 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1643 static PyObject *__pyx_builtin_range;
1644 static PyObject *__pyx_builtin_ValueError;
1645 static PyObject *__pyx_builtin_RuntimeError;
1646 static PyObject *__pyx_builtin_ImportError;
1647 static const char __pyx_k_I[] =
"I";
1648 static const char __pyx_k_J[] =
"J";
1649 static const char __pyx_k_d[] =
"d";
1650 static const char __pyx_k_i[] =
"i";
1651 static const char __pyx_k_j[] =
"j";
1652 static const char __pyx_k_k[] =
"k";
1653 static const char __pyx_k_m[] =
"m";
1654 static const char __pyx_k_n[] =
"n";
1655 static const char __pyx_k_q[] =
"q";
1656 static const char __pyx_k_t[] =
"t";
1657 static const char __pyx_k_v[] =
"v";
1658 static const char __pyx_k_w[] =
"w";
1659 static const char __pyx_k_x[] =
"x";
1660 static const char __pyx_k_dS[] =
"dS";
1661 static const char __pyx_k_dV[] =
"dV";
1662 static const char __pyx_k_df[] =
"df";
1663 static const char __pyx_k_dm[] =
"dm";
1664 static const char __pyx_k_eN[] =
"eN";
1665 static const char __pyx_k_ii[] =
"ii";
1666 static const char __pyx_k_kb[] =
"kb";
1667 static const char __pyx_k_mt[] =
"mt";
1668 static const char __pyx_k_nd[] =
"nd";
1669 static const char __pyx_k_pi[] =
"pi";
1670 static const char __pyx_k_xc[] =
"xc";
1671 static const char __pyx_k_yc[] =
"yc";
1672 static const char __pyx_k_KWr[] =
"KWr";
1673 static const char __pyx_k_KWs[] =
"KWs";
1674 static const char __pyx_k_dmt[] =
"dmt";
1675 static const char __pyx_k_dot[] =
"dot";
1676 static const char __pyx_k_ebN[] =
"ebN";
1677 static const char __pyx_k_l2g[] =
"l2g";
1678 static const char __pyx_k_nnz[] =
"nnz";
1679 static const char __pyx_k_q_m[] =
"q_m";
1680 static const char __pyx_k_q_r[] =
"q_r";
1681 static const char __pyx_k_q_u[] =
"q_u";
1682 static const char __pyx_k_q_x[] =
"q_x";
1683 static const char __pyx_k_rho[] =
"rho";
1684 static const char __pyx_k_sum[] =
"sum";
1685 static const char __pyx_k_u_j[] =
"u_j";
1686 static const char __pyx_k_vol[] =
"vol";
1687 static const char __pyx_k_a_eN[] =
"a_eN";
1688 static const char __pyx_k_a_up[] =
"a_up";
1689 static const char __pyx_k_beta[] =
"beta";
1690 static const char __pyx_k_ebNE[] =
"ebNE";
1691 static const char __pyx_k_f_up[] =
"f_up";
1692 static const char __pyx_k_flat[] =
"flat";
1693 static const char __pyx_k_flux[] =
"flux";
1694 static const char __pyx_k_main[] =
"__main__";
1695 static const char __pyx_k_one8[] =
"one8";
1696 static const char __pyx_k_psiC[] =
"psiC";
1697 static const char __pyx_k_q_dm[] =
"q_dm";
1698 static const char __pyx_k_q_kr[] =
"q_kr";
1699 static const char __pyx_k_q_mt[] =
"q_mt";
1700 static const char __pyx_k_rho2[] =
"rho2";
1701 static const char __pyx_k_rhom[] =
"rhom";
1702 static const char __pyx_k_sBar[] =
"sBar";
1703 static const char __pyx_k_test[] =
"__test__";
1704 static const char __pyx_k_u_eN[] =
"u_eN";
1705 static const char __pyx_k_vBar[] =
"vBar";
1706 static const char __pyx_k_a_avg[] =
"a_avg";
1707 static const char __pyx_k_alpha[] =
"alpha";
1708 static const char __pyx_k_clock[] =
"clock";
1709 static const char __pyx_k_denom[] =
"denom";
1710 static const char __pyx_k_drhom[] =
"drhom";
1711 static const char __pyx_k_kr_eN[] =
"kr_eN";
1712 static const char __pyx_k_matID[] =
"matID";
1713 static const char __pyx_k_numer[] =
"numer";
1714 static const char __pyx_k_numpy[] =
"numpy";
1715 static const char __pyx_k_pcBar[] =
"pcBar";
1716 static const char __pyx_k_q_dkr[] =
"q_dkr";
1717 static const char __pyx_k_q_dmt[] =
"q_dmt";
1718 static const char __pyx_k_range[] =
"range";
1719 static const char __pyx_k_shape[] =
"shape";
1720 static const char __pyx_k_u_dof[] =
"u_dof";
1721 static const char __pyx_k_u_l2g[] =
"u_l2g";
1722 static const char __pyx_k_vBar2[] =
"vBar2";
1723 static const char __pyx_k_vol_e[] =
"vol_e";
1724 static const char __pyx_k_zeros[] =
"zeros";
1725 static const char __pyx_k_a_neig[] =
"a_neig";
1726 static const char __pyx_k_colind[] =
"colind";
1727 static const char __pyx_k_dkr_up[] =
"dkr_up";
1728 static const char __pyx_k_import[] =
"__import__";
1729 static const char __pyx_k_mt_avg[] =
"mt_avg";
1730 static const char __pyx_k_nSpace[] =
"nSpace";
1731 static const char __pyx_k_phi_eN[] =
"phi_eN";
1732 static const char __pyx_k_picard[] =
"picard";
1733 static const char __pyx_k_q_alin[] =
"q_alin";
1734 static const char __pyx_k_q_detJ[] =
"q_detJ";
1735 static const char __pyx_k_q_flin[] =
"q_flin";
1736 static const char __pyx_k_q_mass[] =
"q_mass";
1737 static const char __pyx_k_q_vals[] =
"q_vals";
1738 static const char __pyx_k_rowptr[] =
"rowptr";
1739 static const char __pyx_k_thetaR[] =
"thetaR";
1740 static const char __pyx_k_thetaS[] =
"thetaS";
1741 static const char __pyx_k_thetaW[] =
"thetaW";
1742 static const char __pyx_k_u_neig[] =
"u_neig";
1743 static const char __pyx_k_volume[] =
"volume";
1744 static const char __pyx_k_weight[] =
"weight";
1745 static const char __pyx_k_df_dofs[] =
"df_dofs";
1746 static const char __pyx_k_eN_left[] =
"eN_left";
1747 static const char __pyx_k_gravity[] =
"gravity";
1748 static const char __pyx_k_kr_neig[] =
"kr_neig";
1749 static const char __pyx_k_nSpace2[] =
"nSpace2";
1750 static const char __pyx_k_omega_e[] =
"omega_e";
1751 static const char __pyx_k_pcBar_n[] =
"pcBar_n";
1752 static const char __pyx_k_q_dmass[] =
"q_dmass";
1753 static const char __pyx_k_q_kr_up[] =
"q_kr_up";
1754 static const char __pyx_k_thetaSR[] =
"thetaSR";
1755 static const char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1756 static const char __pyx_k_eN_right[] =
"eN_right";
1757 static const char __pyx_k_ebq_vals[] =
"ebq_vals";
1758 static const char __pyx_k_integral[] =
"integral";
1759 static const char __pyx_k_material[] =
"material";
1760 static const char __pyx_k_phi_neig[] =
"phi_neig";
1761 static const char __pyx_k_q_grad_u[] =
"q_grad_u";
1762 static const char __pyx_k_q_grad_v[] =
"q_grad_v";
1763 static const char __pyx_k_q_grad_w[] =
"q_grad_w";
1764 static const char __pyx_k_ebN_local[] =
"ebN_local";
1765 static const char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1766 static const char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1767 static const char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1768 static const char __pyx_k_transient[] =
"transient";
1769 static const char __pyx_k_volFactor[] =
"volFactor";
1770 static const char __pyx_k_zVelocity[] =
"zVelocity";
1771 static const char __pyx_k_zvelocity[] =
"zvelocity";
1772 static const char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1773 static const char __pyx_k_ValueError[] =
"ValueError";
1774 static const char __pyx_k_matID_neig[] =
"matID_neig";
1775 static const char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1776 static const char __pyx_k_upwindFlag[] =
"upwindFlag";
1777 static const char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1778 static const char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1779 static const char __pyx_k_ImportError[] =
"ImportError";
1780 static const char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1781 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1782 static const char __pyx_k_tForReversal[] =
"tForReversal";
1783 static const char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1784 static const char __pyx_k_material_left[] =
"material_left";
1785 static const char __pyx_k_weak_residual[] =
"weak_residual";
1786 static const char __pyx_k_material_right[] =
"material_right";
1787 static const char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1788 static const char __pyx_k_elementJacobian[] =
"elementJacobian";
1789 static const char __pyx_k_elementResidual[] =
"elementResidual";
1790 static const char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
1791 static const char __pyx_k_nElements_global[] =
"nElements_global";
1792 static const char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
1793 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1794 static const char __pyx_k_material_functions[] =
"material_functions";
1795 static const char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
1796 static const char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
1797 static const char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
1798 static const char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
1799 static const char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
1800 static const char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
1801 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1802 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1803 static const char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
1804 static const char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
1805 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1806 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
1807 static const char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
1808 static const char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
1809 static const char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
1810 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1811 static const char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
1812 static const char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
1813 static const char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
1814 static const char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
1815 static const char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
1816 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
1817 static const char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
1818 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
1819 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
1820 static const char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
1821 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
1822 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1823 static const char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
1824 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1825 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1826 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1827 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
1828 static const char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
1829 static const char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
1830 static const char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1831 static const char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
1832 static const char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
1833 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1834 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
1835 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1836 static const char __pyx_k_proteus_subsurfaceTransportFunct[] =
"proteus/subsurfaceTransportFunctions.pyx";
1837 static const char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
1838 static const char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
1839 static const char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1840 static const char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1841 static const char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
1842 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1843 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
1844 static const char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
1845 static const char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1846 static const char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1847 static const char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1848 static const char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
1849 static const char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1850 static const char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1851 static PyObject *__pyx_n_s_DKWr_DpsiC;
1852 static PyObject *__pyx_n_s_DsBar_DpsiC;
1853 static PyObject *__pyx_n_s_DthetaW_DpsiC;
1854 static PyObject *__pyx_n_s_DvBar_DpsiC;
1855 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1856 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1857 static PyObject *__pyx_n_s_I;
1858 static PyObject *__pyx_n_s_ImportError;
1859 static PyObject *__pyx_n_s_J;
1860 static PyObject *__pyx_n_s_KWr;
1861 static PyObject *__pyx_n_s_KWs;
1862 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1863 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
1864 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
1865 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
1866 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
1867 static PyObject *__pyx_n_s_RuntimeError;
1868 static PyObject *__pyx_n_s_ValueError;
1869 static PyObject *__pyx_n_s_a_avg;
1870 static PyObject *__pyx_n_s_a_eN;
1871 static PyObject *__pyx_n_s_a_neig;
1872 static PyObject *__pyx_n_s_a_up;
1873 static PyObject *__pyx_n_s_alpha;
1874 static PyObject *__pyx_n_s_beta;
1875 static PyObject *__pyx_n_s_calculateNormalFlux;
1876 static PyObject *__pyx_n_s_characteristic_velocity;
1877 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
1878 static PyObject *__pyx_n_s_cline_in_traceback;
1879 static PyObject *__pyx_n_s_clock;
1880 static PyObject *__pyx_n_s_colind;
1881 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
1882 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
1883 static PyObject *__pyx_n_s_d;
1884 static PyObject *__pyx_n_s_dS;
1885 static PyObject *__pyx_n_s_dV;
1886 static PyObject *__pyx_n_s_denom;
1887 static PyObject *__pyx_n_s_df;
1888 static PyObject *__pyx_n_s_df_dofs;
1889 static PyObject *__pyx_n_s_dkr_up;
1890 static PyObject *__pyx_n_s_dm;
1891 static PyObject *__pyx_n_s_dmt;
1892 static PyObject *__pyx_n_s_dmtj_avg;
1893 static PyObject *__pyx_n_s_dot;
1894 static PyObject *__pyx_n_s_drhom;
1895 static PyObject *__pyx_n_s_eN;
1896 static PyObject *__pyx_n_s_eN_left;
1897 static PyObject *__pyx_n_s_eN_neighbor;
1898 static PyObject *__pyx_n_s_eN_right;
1899 static PyObject *__pyx_n_s_ebN;
1900 static PyObject *__pyx_n_s_ebNE;
1901 static PyObject *__pyx_n_s_ebN_local;
1902 static PyObject *__pyx_n_s_ebq_global_vals;
1903 static PyObject *__pyx_n_s_ebq_vals;
1904 static PyObject *__pyx_n_s_elementBarycentersArray;
1905 static PyObject *__pyx_n_s_elementBoundariesArray;
1906 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
1907 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
1908 static PyObject *__pyx_n_s_elementBoundaryTypes;
1909 static PyObject *__pyx_n_s_elementJacobian;
1910 static PyObject *__pyx_n_s_elementMaterialTypes;
1911 static PyObject *__pyx_n_s_elementNeighborsArray;
1912 static PyObject *__pyx_n_s_elementResidual;
1913 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
1914 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
1915 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
1916 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
1917 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
1918 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
1919 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
1920 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
1921 static PyObject *__pyx_n_s_f_up;
1922 static PyObject *__pyx_n_s_flat;
1923 static PyObject *__pyx_n_s_flux;
1924 static PyObject *__pyx_n_s_gravity;
1925 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
1926 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
1927 static PyObject *__pyx_n_s_i;
1928 static PyObject *__pyx_n_s_ii;
1929 static PyObject *__pyx_n_s_import;
1930 static PyObject *__pyx_n_s_integral;
1931 static PyObject *__pyx_n_s_j;
1932 static PyObject *__pyx_n_s_jacobian_weak_residual;
1933 static PyObject *__pyx_n_s_k;
1934 static PyObject *__pyx_n_s_kb;
1935 static PyObject *__pyx_n_s_kr_eN;
1936 static PyObject *__pyx_n_s_kr_neig;
1937 static PyObject *__pyx_n_s_l2g;
1938 static PyObject *__pyx_n_s_m;
1939 static PyObject *__pyx_n_s_main;
1940 static PyObject *__pyx_n_s_matID;
1941 static PyObject *__pyx_n_s_matID_neig;
1942 static PyObject *__pyx_n_s_material;
1943 static PyObject *__pyx_n_s_material_functions;
1944 static PyObject *__pyx_n_s_material_left;
1945 static PyObject *__pyx_n_s_material_right;
1946 static PyObject *__pyx_n_s_mt;
1947 static PyObject *__pyx_n_s_mt_avg;
1948 static PyObject *__pyx_n_s_n;
1949 static PyObject *__pyx_n_s_nAvgWeight;
1950 static PyObject *__pyx_n_s_nDOF_test_element;
1951 static PyObject *__pyx_n_s_nDOF_trial_element;
1952 static PyObject *__pyx_n_s_nElementBoundaries_element;
1953 static PyObject *__pyx_n_s_nElementBoundaries_global;
1954 static PyObject *__pyx_n_s_nElements_global;
1955 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
1956 static PyObject *__pyx_n_s_nSpace;
1957 static PyObject *__pyx_n_s_nSpace2;
1958 static PyObject *__pyx_n_s_nd;
1959 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1960 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1961 static PyObject *__pyx_n_s_nnz;
1962 static PyObject *__pyx_n_s_numer;
1963 static PyObject *__pyx_n_s_numpy;
1964 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1965 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1966 static PyObject *__pyx_n_s_omega_e;
1967 static PyObject *__pyx_n_s_one8;
1968 static PyObject *__pyx_n_s_onePlus_pcBar_n;
1969 static PyObject *__pyx_n_s_pcBar;
1970 static PyObject *__pyx_n_s_pcBar_n;
1971 static PyObject *__pyx_n_s_pcBar_nM1;
1972 static PyObject *__pyx_n_s_pcBar_nM2;
1973 static PyObject *__pyx_n_s_phi_eN;
1974 static PyObject *__pyx_n_s_phi_neig;
1975 static PyObject *__pyx_n_s_pi;
1976 static PyObject *__pyx_n_s_picard;
1977 static PyObject *__pyx_kp_s_proteus_subsurfaceTransportFunct;
1978 static PyObject *__pyx_n_s_psiC;
1979 static PyObject *__pyx_n_s_q;
1980 static PyObject *__pyx_n_s_q_alin;
1981 static PyObject *__pyx_n_s_q_detJ;
1982 static PyObject *__pyx_n_s_q_dkr;
1983 static PyObject *__pyx_n_s_q_dm;
1984 static PyObject *__pyx_n_s_q_dmass;
1985 static PyObject *__pyx_n_s_q_dmt;
1986 static PyObject *__pyx_n_s_q_flin;
1987 static PyObject *__pyx_n_s_q_grad_u;
1988 static PyObject *__pyx_n_s_q_grad_v;
1989 static PyObject *__pyx_n_s_q_grad_w;
1990 static PyObject *__pyx_n_s_q_kr;
1991 static PyObject *__pyx_n_s_q_kr_up;
1992 static PyObject *__pyx_n_s_q_m;
1993 static PyObject *__pyx_n_s_q_mass;
1994 static PyObject *__pyx_n_s_q_mt;
1995 static PyObject *__pyx_n_s_q_r;
1996 static PyObject *__pyx_n_s_q_u;
1997 static PyObject *__pyx_n_s_q_vals;
1998 static PyObject *__pyx_n_s_q_x;
1999 static PyObject *__pyx_n_s_range;
2000 static PyObject *__pyx_n_s_rho;
2001 static PyObject *__pyx_n_s_rho2;
2002 static PyObject *__pyx_n_s_rhom;
2003 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
2004 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
2005 static PyObject *__pyx_n_s_rowptr;
2006 static PyObject *__pyx_n_s_sBar;
2007 static PyObject *__pyx_n_s_setElementBoundariesArray;
2008 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
2009 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
2010 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
2011 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
2012 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
2013 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
2014 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
2015 static PyObject *__pyx_n_s_shape;
2016 static PyObject *__pyx_n_s_sqrt_sBar;
2017 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
2018 static PyObject *__pyx_n_s_sum;
2019 static PyObject *__pyx_n_s_t;
2020 static PyObject *__pyx_n_s_tForReversal;
2021 static PyObject *__pyx_n_s_test;
2022 static PyObject *__pyx_n_s_thetaR;
2023 static PyObject *__pyx_n_s_thetaS;
2024 static PyObject *__pyx_n_s_thetaSR;
2025 static PyObject *__pyx_n_s_thetaW;
2026 static PyObject *__pyx_n_s_thisElementIsUpwind;
2027 static PyObject *__pyx_n_s_transient;
2028 static PyObject *__pyx_n_s_u_dof;
2029 static PyObject *__pyx_n_s_u_eN;
2030 static PyObject *__pyx_n_s_u_j;
2031 static PyObject *__pyx_n_s_u_l2g;
2032 static PyObject *__pyx_n_s_u_neig;
2033 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2034 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
2035 static PyObject *__pyx_n_s_updateMass_weakAvg;
2036 static PyObject *__pyx_n_s_upwindFlag;
2037 static PyObject *__pyx_n_s_v;
2038 static PyObject *__pyx_n_s_vBar;
2039 static PyObject *__pyx_n_s_vBar2;
2040 static PyObject *__pyx_n_s_vol;
2041 static PyObject *__pyx_n_s_volFactor;
2042 static PyObject *__pyx_n_s_vol_e;
2043 static PyObject *__pyx_n_s_volume;
2044 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
2045 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
2046 static PyObject *__pyx_n_s_w;
2047 static PyObject *__pyx_n_s_weak_residual;
2048 static PyObject *__pyx_n_s_weight;
2049 static PyObject *__pyx_n_s_x;
2050 static PyObject *__pyx_n_s_xc;
2051 static PyObject *__pyx_n_s_yc;
2052 static PyObject *__pyx_n_s_zVelocity;
2053 static PyObject *__pyx_n_s_zeros;
2054 static PyObject *__pyx_n_s_zvelocity;
2055 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
2056 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
2057 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2058 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2059 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2060 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2061 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2062 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2063 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2064 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2065 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2066 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2067 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2068 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2069 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
2070 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
2071 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
2072 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
2073 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
2074 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
2075 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
2076 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2077 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2078 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2079 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2080 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2081 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2082 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2083 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2084 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2085 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2086 static PyObject *__pyx_float_0_0;
2087 static PyObject *__pyx_float_0_5;
2088 static PyObject *__pyx_float_2_0;
2089 static PyObject *__pyx_float_1_0eneg_20;
2090 static PyObject *__pyx_slice_;
2091 static PyObject *__pyx_slice__2;
2092 static PyObject *__pyx_slice__3;
2093 static PyObject *__pyx_slice__4;
2094 static PyObject *__pyx_slice__5;
2095 static PyObject *__pyx_slice__6;
2096 static PyObject *__pyx_slice__7;
2097 static PyObject *__pyx_slice__8;
2098 static PyObject *__pyx_tuple__9;
2099 static PyObject *__pyx_tuple__10;
2100 static PyObject *__pyx_tuple__11;
2101 static PyObject *__pyx_tuple__12;
2102 static PyObject *__pyx_tuple__13;
2103 static PyObject *__pyx_tuple__14;
2104 static PyObject *__pyx_tuple__15;
2105 static PyObject *__pyx_tuple__16;
2106 static PyObject *__pyx_tuple__17;
2107 static PyObject *__pyx_tuple__18;
2108 static PyObject *__pyx_tuple__20;
2109 static PyObject *__pyx_tuple__22;
2110 static PyObject *__pyx_tuple__24;
2111 static PyObject *__pyx_tuple__26;
2112 static PyObject *__pyx_tuple__28;
2113 static PyObject *__pyx_tuple__30;
2114 static PyObject *__pyx_tuple__32;
2115 static PyObject *__pyx_tuple__34;
2116 static PyObject *__pyx_tuple__36;
2117 static PyObject *__pyx_tuple__38;
2118 static PyObject *__pyx_tuple__40;
2119 static PyObject *__pyx_tuple__42;
2120 static PyObject *__pyx_tuple__44;
2121 static PyObject *__pyx_tuple__46;
2122 static PyObject *__pyx_tuple__48;
2123 static PyObject *__pyx_tuple__50;
2124 static PyObject *__pyx_tuple__52;
2125 static PyObject *__pyx_tuple__54;
2126 static PyObject *__pyx_tuple__56;
2127 static PyObject *__pyx_tuple__58;
2128 static PyObject *__pyx_tuple__60;
2129 static PyObject *__pyx_tuple__62;
2130 static PyObject *__pyx_tuple__64;
2131 static PyObject *__pyx_tuple__66;
2132 static PyObject *__pyx_tuple__68;
2133 static PyObject *__pyx_tuple__70;
2134 static PyObject *__pyx_tuple__72;
2135 static PyObject *__pyx_tuple__74;
2136 static PyObject *__pyx_codeobj__19;
2137 static PyObject *__pyx_codeobj__21;
2138 static PyObject *__pyx_codeobj__23;
2139 static PyObject *__pyx_codeobj__25;
2140 static PyObject *__pyx_codeobj__27;
2141 static PyObject *__pyx_codeobj__29;
2142 static PyObject *__pyx_codeobj__31;
2143 static PyObject *__pyx_codeobj__33;
2144 static PyObject *__pyx_codeobj__35;
2145 static PyObject *__pyx_codeobj__37;
2146 static PyObject *__pyx_codeobj__39;
2147 static PyObject *__pyx_codeobj__41;
2148 static PyObject *__pyx_codeobj__43;
2149 static PyObject *__pyx_codeobj__45;
2150 static PyObject *__pyx_codeobj__47;
2151 static PyObject *__pyx_codeobj__49;
2152 static PyObject *__pyx_codeobj__51;
2153 static PyObject *__pyx_codeobj__53;
2154 static PyObject *__pyx_codeobj__55;
2155 static PyObject *__pyx_codeobj__57;
2156 static PyObject *__pyx_codeobj__59;
2157 static PyObject *__pyx_codeobj__61;
2158 static PyObject *__pyx_codeobj__63;
2159 static PyObject *__pyx_codeobj__65;
2160 static PyObject *__pyx_codeobj__67;
2161 static PyObject *__pyx_codeobj__69;
2162 static PyObject *__pyx_codeobj__71;
2163 static PyObject *__pyx_codeobj__73;
2164 static PyObject *__pyx_codeobj__75;
2175 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
2177 __Pyx_RefNannyDeclarations
2179 __Pyx_RefNannySetupContext(
"double_max", 0);
2180 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2181 __pyx_t_1 = __pyx_v_a;
2183 __pyx_t_1 = __pyx_v_b;
2185 __pyx_r = __pyx_t_1;
2190 __Pyx_RefNannyFinishContext();
2202 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
2204 __Pyx_RefNannyDeclarations
2206 __Pyx_RefNannySetupContext(
"double_min", 0);
2207 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2208 __pyx_t_1 = __pyx_v_a;
2210 __pyx_t_1 = __pyx_v_b;
2212 __pyx_r = __pyx_t_1;
2217 __Pyx_RefNannyFinishContext();
2230 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2231 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
2232 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2233 int __pyx_v_nExteriorElementBoundaries_global;
2234 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2235 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2236 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2237 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
2238 PyObject *__pyx_r = 0;
2239 __Pyx_RefNannyDeclarations
2240 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
2242 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
2243 PyObject* values[5] = {0,0,0,0,0};
2244 if (unlikely(__pyx_kwds)) {
2246 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2248 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2250 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2252 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2254 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2256 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2259 default:
goto __pyx_L5_argtuple_error;
2261 kw_args = PyDict_Size(__pyx_kwds);
2264 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2265 else goto __pyx_L5_argtuple_error;
2268 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2270 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error)
2274 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2276 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error)
2280 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2282 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error)
2286 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
2288 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error)
2291 if (unlikely(kw_args > 0)) {
2292 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
2294 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2295 goto __pyx_L5_argtuple_error;
2297 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2298 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2299 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2300 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2301 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2303 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2304 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
2305 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
2306 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
2307 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
2309 goto __pyx_L4_argument_unpacking_done;
2310 __pyx_L5_argtuple_error:;
2311 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error)
2313 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2314 __Pyx_RefNannyFinishContext();
2316 __pyx_L4_argument_unpacking_done:;
2317 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2318 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2319 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2320 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2321 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
2328 __Pyx_RefNannyFinishContext();
2332 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
2336 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2337 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2338 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2339 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2340 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
2341 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
2342 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
2343 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2344 PyObject *__pyx_r = NULL;
2345 __Pyx_RefNannyDeclarations
2349 Py_ssize_t __pyx_t_4;
2351 Py_ssize_t __pyx_t_6;
2352 Py_ssize_t __pyx_t_7;
2353 Py_ssize_t __pyx_t_8;
2354 Py_ssize_t __pyx_t_9;
2355 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
2356 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
2357 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
2358 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
2359 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
2360 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2361 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2362 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2363 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2364 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2365 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2366 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2367 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2368 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
2369 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
2370 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
2371 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2373 __Pyx_BufFmt_StackElem __pyx_stack[1];
2374 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2376 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
2378 __Pyx_BufFmt_StackElem __pyx_stack[1];
2379 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2381 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2383 __Pyx_BufFmt_StackElem __pyx_stack[1];
2384 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2386 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2388 __Pyx_BufFmt_StackElem __pyx_stack[1];
2389 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2391 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
2400 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
2401 __pyx_t_2 = __pyx_t_1;
2402 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2403 __pyx_v_ebNE = __pyx_t_3;
2412 __pyx_t_4 = __pyx_v_ebNE;
2414 if (__pyx_t_4 < 0) {
2415 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
2416 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2417 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_5 = 0;
2418 if (unlikely(__pyx_t_5 != -1)) {
2419 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2420 __PYX_ERR(0, 25, __pyx_L1_error)
2422 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
2431 __pyx_t_6 = __pyx_v_ebN;
2434 if (__pyx_t_6 < 0) {
2435 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2436 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2437 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2438 if (__pyx_t_7 < 0) {
2439 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2440 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
2441 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2442 if (unlikely(__pyx_t_5 != -1)) {
2443 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2444 __PYX_ERR(0, 26, __pyx_L1_error)
2446 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2455 __pyx_t_8 = __pyx_v_eN;
2457 if (__pyx_t_8 < 0) {
2458 __pyx_t_8 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2459 if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 0;
2460 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2461 if (unlikely(__pyx_t_5 != -1)) {
2462 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2463 __PYX_ERR(0, 27, __pyx_L1_error)
2465 __pyx_t_9 = __pyx_v_ebNE;
2467 if (__pyx_t_9 < 0) {
2468 __pyx_t_9 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
2469 if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
2470 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2471 if (unlikely(__pyx_t_5 != -1)) {
2472 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2473 __PYX_ERR(0, 27, __pyx_L1_error)
2475 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2487 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2490 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2491 __Pyx_PyThreadState_declare
2492 __Pyx_PyThreadState_assign
2493 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2494 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2495 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2496 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2497 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2498 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2499 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2503 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2504 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2505 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2506 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2508 __Pyx_XGIVEREF(__pyx_r);
2509 __Pyx_RefNannyFinishContext();
2522 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2523 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2524 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2525 int __pyx_v_nElementBoundaries_global;
2526 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2527 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2528 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2529 PyObject *__pyx_r = 0;
2530 __Pyx_RefNannyDeclarations
2531 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2533 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2534 PyObject* values[4] = {0,0,0,0};
2535 if (unlikely(__pyx_kwds)) {
2537 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2539 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2541 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2543 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2545 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2548 default:
goto __pyx_L5_argtuple_error;
2550 kw_args = PyDict_Size(__pyx_kwds);
2553 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2554 else goto __pyx_L5_argtuple_error;
2557 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2559 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2563 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2565 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2569 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2571 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2574 if (unlikely(kw_args > 0)) {
2575 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2577 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2578 goto __pyx_L5_argtuple_error;
2580 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2581 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2582 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2583 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2585 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2586 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2587 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2588 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2590 goto __pyx_L4_argument_unpacking_done;
2591 __pyx_L5_argtuple_error:;
2592 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2594 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2595 __Pyx_RefNannyFinishContext();
2597 __pyx_L4_argument_unpacking_done:;
2598 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
2599 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
2600 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2601 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2608 __Pyx_RefNannyFinishContext();
2612 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2614 int __pyx_v_eN_left;
2615 int __pyx_v_eN_right;
2616 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2617 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2618 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2619 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2620 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2621 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2622 PyObject *__pyx_r = NULL;
2623 __Pyx_RefNannyDeclarations
2627 Py_ssize_t __pyx_t_4;
2628 Py_ssize_t __pyx_t_5;
2630 Py_ssize_t __pyx_t_7;
2631 Py_ssize_t __pyx_t_8;
2632 Py_ssize_t __pyx_t_9;
2633 Py_ssize_t __pyx_t_10;
2634 Py_ssize_t __pyx_t_11;
2635 Py_ssize_t __pyx_t_12;
2636 Py_ssize_t __pyx_t_13;
2637 Py_ssize_t __pyx_t_14;
2639 Py_ssize_t __pyx_t_16;
2640 Py_ssize_t __pyx_t_17;
2641 Py_ssize_t __pyx_t_18;
2642 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2643 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2644 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2645 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2646 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2647 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2648 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2649 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2650 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2651 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2652 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2653 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2654 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2656 __Pyx_BufFmt_StackElem __pyx_stack[1];
2657 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2659 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2661 __Pyx_BufFmt_StackElem __pyx_stack[1];
2662 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2664 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2666 __Pyx_BufFmt_StackElem __pyx_stack[1];
2667 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2669 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2678 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2679 __pyx_t_2 = __pyx_t_1;
2680 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2681 __pyx_v_ebN = __pyx_t_3;
2690 __pyx_t_4 = __pyx_v_ebN;
2693 if (__pyx_t_4 < 0) {
2694 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2695 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2696 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2697 if (__pyx_t_5 < 0) {
2698 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2699 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2700 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2701 if (unlikely(__pyx_t_6 != -1)) {
2702 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2703 __PYX_ERR(0, 35, __pyx_L1_error)
2705 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2714 __pyx_t_7 = __pyx_v_ebN;
2717 if (__pyx_t_7 < 0) {
2718 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2719 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
2720 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2721 if (__pyx_t_8 < 0) {
2722 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2723 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
2724 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2725 if (unlikely(__pyx_t_6 != -1)) {
2726 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2727 __PYX_ERR(0, 36, __pyx_L1_error)
2729 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2738 __pyx_t_9 = __pyx_v_eN_left;
2740 if (__pyx_t_9 < 0) {
2741 __pyx_t_9 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2742 if (unlikely(__pyx_t_9 < 0)) __pyx_t_6 = 0;
2743 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2744 if (unlikely(__pyx_t_6 != -1)) {
2745 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2746 __PYX_ERR(0, 37, __pyx_L1_error)
2748 __pyx_t_10 = __pyx_v_ebN;
2751 if (__pyx_t_10 < 0) {
2752 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2753 if (unlikely(__pyx_t_10 < 0)) __pyx_t_6 = 0;
2754 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2755 if (__pyx_t_11 < 0) {
2756 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2757 if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 1;
2758 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2759 if (unlikely(__pyx_t_6 != -1)) {
2760 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2761 __PYX_ERR(0, 37, __pyx_L1_error)
2763 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2772 __pyx_t_12 = __pyx_v_eN_left;
2774 if (__pyx_t_12 < 0) {
2775 __pyx_t_12 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2776 if (unlikely(__pyx_t_12 < 0)) __pyx_t_6 = 0;
2777 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2778 if (unlikely(__pyx_t_6 != -1)) {
2779 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2780 __PYX_ERR(0, 38, __pyx_L1_error)
2782 __pyx_t_13 = __pyx_v_ebN;
2785 if (__pyx_t_13 < 0) {
2786 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2787 if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
2788 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2789 if (__pyx_t_14 < 0) {
2790 __pyx_t_14 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2791 if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 1;
2792 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2793 if (unlikely(__pyx_t_6 != -1)) {
2794 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2795 __PYX_ERR(0, 38, __pyx_L1_error)
2797 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2806 __pyx_t_15 = ((__pyx_v_eN_right >= 0) != 0);
2816 __pyx_t_16 = __pyx_v_eN_right;
2818 if (__pyx_t_16 < 0) {
2819 __pyx_t_16 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2820 if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
2821 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2822 if (unlikely(__pyx_t_6 != -1)) {
2823 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2824 __PYX_ERR(0, 40, __pyx_L1_error)
2826 __pyx_t_17 = __pyx_v_ebN;
2829 if (__pyx_t_17 < 0) {
2830 __pyx_t_17 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2831 if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
2832 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2833 if (__pyx_t_18 < 0) {
2834 __pyx_t_18 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2835 if (unlikely(__pyx_t_18 < 0)) __pyx_t_6 = 1;
2836 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2837 if (unlikely(__pyx_t_6 != -1)) {
2838 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2839 __PYX_ERR(0, 40, __pyx_L1_error)
2841 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2862 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2865 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2866 __Pyx_PyThreadState_declare
2867 __Pyx_PyThreadState_assign
2868 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2869 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2870 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2871 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2872 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2873 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2877 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2878 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2879 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2881 __Pyx_XGIVEREF(__pyx_r);
2882 __Pyx_RefNannyFinishContext();
2895 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2896 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
2897 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
2898 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2899 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2900 PyArrayObject *__pyx_v_q_vals = 0;
2901 PyObject *__pyx_v_material_functions = 0;
2902 PyObject *__pyx_r = 0;
2903 __Pyx_RefNannyDeclarations
2904 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
2906 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
2907 PyObject* values[3] = {0,0,0};
2908 if (unlikely(__pyx_kwds)) {
2910 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2912 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2914 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2916 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2919 default:
goto __pyx_L5_argtuple_error;
2921 kw_args = PyDict_Size(__pyx_kwds);
2924 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2925 else goto __pyx_L5_argtuple_error;
2928 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
2930 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 43, __pyx_L3_error)
2934 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
2936 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 43, __pyx_L3_error)
2939 if (unlikely(kw_args > 0)) {
2940 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 43, __pyx_L3_error)
2942 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2943 goto __pyx_L5_argtuple_error;
2945 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2946 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2947 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2949 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
2950 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
2951 __pyx_v_material_functions = ((PyObject*)values[2]);
2953 goto __pyx_L4_argument_unpacking_done;
2954 __pyx_L5_argtuple_error:;
2955 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error)
2957 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2958 __Pyx_RefNannyFinishContext();
2960 __pyx_L4_argument_unpacking_done:;
2961 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
2962 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
2963 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 45, __pyx_L1_error)
2964 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
2971 __Pyx_RefNannyFinishContext();
2975 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
2978 int __pyx_v_material;
2979 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2980 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2981 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
2982 __Pyx_Buffer __pyx_pybuffer_q_vals;
2983 PyObject *__pyx_r = NULL;
2984 __Pyx_RefNannyDeclarations
2988 Py_ssize_t __pyx_t_4;
2992 PyObject *__pyx_t_8 = NULL;
2993 PyObject *__pyx_t_9 = NULL;
2994 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_10;
2995 Py_ssize_t __pyx_t_11;
2996 Py_ssize_t __pyx_t_12;
2998 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
2999 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3000 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3001 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3002 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3003 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3004 __pyx_pybuffer_q_vals.refcount = 0;
3005 __pyx_pybuffernd_q_vals.data = NULL;
3006 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3008 __Pyx_BufFmt_StackElem __pyx_stack[1];
3009 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3011 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3013 __Pyx_BufFmt_StackElem __pyx_stack[1];
3014 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3016 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
3025 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3026 __pyx_t_2 = __pyx_t_1;
3027 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3028 __pyx_v_eN = __pyx_t_3;
3037 __pyx_t_4 = __pyx_v_eN;
3039 if (__pyx_t_4 < 0) {
3040 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3041 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3042 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3043 if (unlikely(__pyx_t_5 != -1)) {
3044 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3045 __PYX_ERR(0, 52, __pyx_L1_error)
3047 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3056 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3057 __pyx_t_7 = __pyx_t_6;
3058 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3059 __pyx_v_k = __pyx_t_5;
3068 if (unlikely(__pyx_v_material_functions == Py_None)) {
3069 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3070 __PYX_ERR(0, 54, __pyx_L1_error)
3072 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error)
3073 __Pyx_GOTREF(__pyx_t_8);
3074 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error)
3075 __Pyx_GOTREF(__pyx_t_9);
3076 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3077 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9);
if (unlikely((__pyx_t_10 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
3078 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3079 __pyx_t_11 = __pyx_v_eN;
3080 __pyx_t_12 = __pyx_v_k;
3082 if (__pyx_t_11 < 0) {
3083 __pyx_t_11 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
3084 if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
3085 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
3086 if (__pyx_t_12 < 0) {
3087 __pyx_t_12 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
3088 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1;
3089 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
3090 if (unlikely(__pyx_t_13 != -1)) {
3091 __Pyx_RaiseBufferIndexError(__pyx_t_13);
3092 __PYX_ERR(0, 54, __pyx_L1_error)
3094 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_10;
3107 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3110 __Pyx_XDECREF(__pyx_t_8);
3111 __Pyx_XDECREF(__pyx_t_9);
3112 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3113 __Pyx_PyThreadState_declare
3114 __Pyx_PyThreadState_assign
3115 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3117 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3118 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3119 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3123 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3124 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3126 __Pyx_XGIVEREF(__pyx_r);
3127 __Pyx_RefNannyFinishContext();
3140 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3141 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
3142 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
3143 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3144 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
3145 PyArrayObject *__pyx_v_q_vals = 0;
3146 PyObject *__pyx_v_material_functions = 0;
3147 PyObject *__pyx_r = 0;
3148 __Pyx_RefNannyDeclarations
3149 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
3151 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3152 PyObject* values[3] = {0,0,0};
3153 if (unlikely(__pyx_kwds)) {
3155 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3157 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3159 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3161 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3164 default:
goto __pyx_L5_argtuple_error;
3166 kw_args = PyDict_Size(__pyx_kwds);
3169 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3170 else goto __pyx_L5_argtuple_error;
3173 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3175 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 56, __pyx_L3_error)
3179 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3181 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 56, __pyx_L3_error)
3184 if (unlikely(kw_args > 0)) {
3185 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
3187 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3188 goto __pyx_L5_argtuple_error;
3190 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3191 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3192 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3194 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3195 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3196 __pyx_v_material_functions = ((PyObject*)values[2]);
3198 goto __pyx_L4_argument_unpacking_done;
3199 __pyx_L5_argtuple_error:;
3200 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
3202 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3203 __Pyx_RefNannyFinishContext();
3205 __pyx_L4_argument_unpacking_done:;
3206 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
3207 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
3208 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
3209 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3216 __Pyx_RefNannyFinishContext();
3220 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3223 int __pyx_v_material;
3224 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3225 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3226 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3227 __Pyx_Buffer __pyx_pybuffer_q_vals;
3228 PyObject *__pyx_r = NULL;
3229 __Pyx_RefNannyDeclarations
3233 Py_ssize_t __pyx_t_4;
3237 PyObject *__pyx_t_8 = NULL;
3238 PyObject *__pyx_t_9 = NULL;
3239 PyObject *__pyx_t_10 = NULL;
3240 PyObject *__pyx_t_11 = NULL;
3241 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
3242 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3243 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3244 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3245 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3246 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3247 __pyx_pybuffer_q_vals.refcount = 0;
3248 __pyx_pybuffernd_q_vals.data = NULL;
3249 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3251 __Pyx_BufFmt_StackElem __pyx_stack[1];
3252 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3254 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3256 __Pyx_BufFmt_StackElem __pyx_stack[1];
3257 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3259 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
3268 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3269 __pyx_t_2 = __pyx_t_1;
3270 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3271 __pyx_v_eN = __pyx_t_3;
3280 __pyx_t_4 = __pyx_v_eN;
3282 if (__pyx_t_4 < 0) {
3283 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3284 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3285 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3286 if (unlikely(__pyx_t_5 != -1)) {
3287 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3288 __PYX_ERR(0, 64, __pyx_L1_error)
3290 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3299 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3300 __pyx_t_7 = __pyx_t_6;
3301 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3302 __pyx_v_k = __pyx_t_5;
3311 if (unlikely(__pyx_v_material_functions == Py_None)) {
3312 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3313 __PYX_ERR(0, 66, __pyx_L1_error)
3315 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3316 __Pyx_GOTREF(__pyx_t_8);
3317 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3318 __Pyx_GOTREF(__pyx_t_9);
3319 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3320 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3321 __Pyx_GOTREF(__pyx_t_8);
3322 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3323 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3324 __Pyx_GOTREF(__pyx_t_9);
3325 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error)
3326 __Pyx_GOTREF(__pyx_t_10);
3327 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 66, __pyx_L1_error)
3328 __Pyx_GOTREF(__pyx_t_11);
3329 __Pyx_GIVEREF(__pyx_t_9);
3330 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
3331 __Pyx_GIVEREF(__pyx_t_10);
3332 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3333 __Pyx_INCREF(__pyx_slice_);
3334 __Pyx_GIVEREF(__pyx_slice_);
3335 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_slice_);
3338 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_11, __pyx_t_8) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3339 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3340 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3353 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3356 __Pyx_XDECREF(__pyx_t_8);
3357 __Pyx_XDECREF(__pyx_t_9);
3358 __Pyx_XDECREF(__pyx_t_10);
3359 __Pyx_XDECREF(__pyx_t_11);
3360 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3361 __Pyx_PyThreadState_declare
3362 __Pyx_PyThreadState_assign
3363 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3364 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3365 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3366 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3367 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3371 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3372 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3374 __Pyx_XGIVEREF(__pyx_r);
3375 __Pyx_RefNannyFinishContext();
3388 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3389 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3390 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
3391 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3392 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3393 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3394 PyArrayObject *__pyx_v_ebq_vals = 0;
3395 PyObject *__pyx_v_material_functions = 0;
3396 PyObject *__pyx_r = 0;
3397 __Pyx_RefNannyDeclarations
3398 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
3400 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3401 PyObject* values[4] = {0,0,0,0};
3402 if (unlikely(__pyx_kwds)) {
3404 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3406 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3408 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3410 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3412 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3415 default:
goto __pyx_L5_argtuple_error;
3417 kw_args = PyDict_Size(__pyx_kwds);
3420 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3421 else goto __pyx_L5_argtuple_error;
3424 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3426 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3430 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3432 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3436 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3438 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3441 if (unlikely(kw_args > 0)) {
3442 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3444 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3445 goto __pyx_L5_argtuple_error;
3447 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3448 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3449 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3450 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3452 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3453 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3454 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
3455 __pyx_v_material_functions = ((PyObject*)values[3]);
3457 goto __pyx_L4_argument_unpacking_done;
3458 __pyx_L5_argtuple_error:;
3459 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3461 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3462 __Pyx_RefNannyFinishContext();
3464 __pyx_L4_argument_unpacking_done:;
3465 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3466 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
3467 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
3468 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 72, __pyx_L1_error)
3469 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3476 __Pyx_RefNannyFinishContext();
3480 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3483 int __pyx_v_ebN_local;
3485 int __pyx_v_material_left;
3486 int __pyx_v_material_right;
3487 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3488 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3489 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3490 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3491 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3492 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3493 PyObject *__pyx_r = NULL;
3494 __Pyx_RefNannyDeclarations
3501 Py_ssize_t __pyx_t_7;
3502 Py_ssize_t __pyx_t_8;
3504 Py_ssize_t __pyx_t_10;
3505 Py_ssize_t __pyx_t_11;
3506 Py_ssize_t __pyx_t_12;
3507 Py_ssize_t __pyx_t_13;
3508 npy_intp __pyx_t_14;
3509 npy_intp __pyx_t_15;
3510 PyObject *__pyx_t_16 = NULL;
3511 PyObject *__pyx_t_17 = NULL;
3512 PyObject *__pyx_t_18 = NULL;
3513 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_19;
3514 Py_ssize_t __pyx_t_20;
3515 Py_ssize_t __pyx_t_21;
3516 Py_ssize_t __pyx_t_22;
3518 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3519 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3520 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3521 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3522 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3523 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3524 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3525 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3526 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3527 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3528 __pyx_pybuffer_ebq_vals.refcount = 0;
3529 __pyx_pybuffernd_ebq_vals.data = NULL;
3530 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3532 __Pyx_BufFmt_StackElem __pyx_stack[1];
3533 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3535 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3537 __Pyx_BufFmt_StackElem __pyx_stack[1];
3538 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3540 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3542 __Pyx_BufFmt_StackElem __pyx_stack[1];
3543 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3545 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3554 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3555 __pyx_t_2 = __pyx_t_1;
3556 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3557 __pyx_v_eN = __pyx_t_3;
3566 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
3567 __pyx_t_5 = __pyx_t_4;
3568 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3569 __pyx_v_ebN_local = __pyx_t_6;
3578 __pyx_t_7 = __pyx_v_eN;
3579 __pyx_t_8 = __pyx_v_ebN_local;
3581 if (__pyx_t_7 < 0) {
3582 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3583 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3584 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
3585 if (__pyx_t_8 < 0) {
3586 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3587 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3588 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
3589 if (unlikely(__pyx_t_9 != -1)) {
3590 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3591 __PYX_ERR(0, 84, __pyx_L1_error)
3593 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3602 __pyx_t_10 = __pyx_v_ebN;
3605 if (__pyx_t_10 < 0) {
3606 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3607 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
3608 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3609 if (__pyx_t_11 < 0) {
3610 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3611 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
3612 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3613 if (unlikely(__pyx_t_9 != -1)) {
3614 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3615 __PYX_ERR(0, 85, __pyx_L1_error)
3617 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3626 __pyx_t_12 = __pyx_v_ebN;
3629 if (__pyx_t_12 < 0) {
3630 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3631 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
3632 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3633 if (__pyx_t_13 < 0) {
3634 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3635 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
3636 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3637 if (unlikely(__pyx_t_9 != -1)) {
3638 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3639 __PYX_ERR(0, 86, __pyx_L1_error)
3641 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3650 __pyx_t_14 = (__pyx_v_ebq_vals->dimensions[2]);
3651 __pyx_t_15 = __pyx_t_14;
3652 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
3653 __pyx_v_k = __pyx_t_9;
3662 if (unlikely(__pyx_v_material_functions == Py_None)) {
3663 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3664 __PYX_ERR(0, 88, __pyx_L1_error)
3666 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 88, __pyx_L1_error)
3667 __Pyx_GOTREF(__pyx_t_16);
3668 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 88, __pyx_L1_error)
3669 __Pyx_GOTREF(__pyx_t_17);
3670 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3679 if (unlikely(__pyx_v_material_functions == Py_None)) {
3680 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3681 __PYX_ERR(0, 89, __pyx_L1_error)
3683 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 89, __pyx_L1_error)
3684 __Pyx_GOTREF(__pyx_t_16);
3685 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 89, __pyx_L1_error)
3686 __Pyx_GOTREF(__pyx_t_18);
3687 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3696 __pyx_t_16 = PyNumber_Add(__pyx_t_17, __pyx_t_18);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 88, __pyx_L1_error)
3697 __Pyx_GOTREF(__pyx_t_16);
3698 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3699 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3700 __pyx_t_18 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 88, __pyx_L1_error)
3701 __Pyx_GOTREF(__pyx_t_18);
3702 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3703 __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_19 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3704 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3705 __pyx_t_20 = __pyx_v_eN;
3706 __pyx_t_21 = __pyx_v_ebN_local;
3707 __pyx_t_22 = __pyx_v_k;
3709 if (__pyx_t_20 < 0) {
3710 __pyx_t_20 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3711 if (unlikely(__pyx_t_20 < 0)) __pyx_t_23 = 0;
3712 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_23 = 0;
3713 if (__pyx_t_21 < 0) {
3714 __pyx_t_21 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3715 if (unlikely(__pyx_t_21 < 0)) __pyx_t_23 = 1;
3716 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_23 = 1;
3717 if (__pyx_t_22 < 0) {
3718 __pyx_t_22 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3719 if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 2;
3720 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_23 = 2;
3721 if (unlikely(__pyx_t_23 != -1)) {
3722 __Pyx_RaiseBufferIndexError(__pyx_t_23);
3723 __PYX_ERR(0, 88, __pyx_L1_error)
3725 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_19;
3739 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3742 __Pyx_XDECREF(__pyx_t_16);
3743 __Pyx_XDECREF(__pyx_t_17);
3744 __Pyx_XDECREF(__pyx_t_18);
3745 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3746 __Pyx_PyThreadState_declare
3747 __Pyx_PyThreadState_assign
3748 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3749 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3750 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3751 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3752 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3753 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3757 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3758 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3759 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3761 __Pyx_XGIVEREF(__pyx_r);
3762 __Pyx_RefNannyFinishContext();
3775 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3776 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3777 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3778 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3780 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3781 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3782 PyArrayObject *__pyx_v_ebq_vals = 0;
3783 PyObject *__pyx_v_material_functions = 0;
3784 PyObject *__pyx_r = 0;
3785 __Pyx_RefNannyDeclarations
3786 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3788 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3789 PyObject* values[5] = {0,0,0,0,0};
3790 if (unlikely(__pyx_kwds)) {
3792 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3794 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3796 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3798 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3800 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3802 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3805 default:
goto __pyx_L5_argtuple_error;
3807 kw_args = PyDict_Size(__pyx_kwds);
3810 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3811 else goto __pyx_L5_argtuple_error;
3814 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3816 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 91, __pyx_L3_error)
3820 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3822 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 91, __pyx_L3_error)
3826 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3828 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 91, __pyx_L3_error)
3832 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3834 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 91, __pyx_L3_error)
3837 if (unlikely(kw_args > 0)) {
3838 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
3840 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3841 goto __pyx_L5_argtuple_error;
3843 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3844 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3845 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3846 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3847 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3849 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
3850 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
3851 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
3852 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
3853 __pyx_v_material_functions = ((PyObject*)values[4]);
3855 goto __pyx_L4_argument_unpacking_done;
3856 __pyx_L5_argtuple_error:;
3857 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
3859 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3860 __Pyx_RefNannyFinishContext();
3862 __pyx_L4_argument_unpacking_done:;
3863 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
3864 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
3865 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
3866 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 95, __pyx_L1_error)
3867 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3874 __Pyx_RefNannyFinishContext();
3878 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3881 int __pyx_v_ebN_local;
3883 int __pyx_v_material_left;
3884 int __pyx_v_material_right;
3887 double __pyx_v_numer;
3888 double __pyx_v_denom;
3889 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3890 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3891 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3892 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3893 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3894 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3895 PyObject *__pyx_r = NULL;
3896 __Pyx_RefNannyDeclarations
3903 Py_ssize_t __pyx_t_7;
3904 Py_ssize_t __pyx_t_8;
3906 Py_ssize_t __pyx_t_10;
3907 Py_ssize_t __pyx_t_11;
3908 Py_ssize_t __pyx_t_12;
3909 Py_ssize_t __pyx_t_13;
3910 npy_intp __pyx_t_14;
3911 npy_intp __pyx_t_15;
3918 PyObject *__pyx_t_22 = NULL;
3919 PyObject *__pyx_t_23 = NULL;
3920 PyObject *__pyx_t_24 = NULL;
3921 PyObject *__pyx_t_25 = NULL;
3922 PyObject *__pyx_t_26 = NULL;
3924 Py_ssize_t __pyx_t_28;
3925 Py_ssize_t __pyx_t_29;
3926 Py_ssize_t __pyx_t_30;
3927 Py_ssize_t __pyx_t_31;
3929 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
3930 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3931 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3932 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3933 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3934 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3935 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3936 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3937 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3938 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3939 __pyx_pybuffer_ebq_vals.refcount = 0;
3940 __pyx_pybuffernd_ebq_vals.data = NULL;
3941 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3943 __Pyx_BufFmt_StackElem __pyx_stack[1];
3944 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
3946 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3948 __Pyx_BufFmt_StackElem __pyx_stack[1];
3949 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
3951 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3953 __Pyx_BufFmt_StackElem __pyx_stack[1];
3954 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
3956 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
3965 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3966 __pyx_t_2 = __pyx_t_1;
3967 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3968 __pyx_v_eN = __pyx_t_3;
3977 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
3978 __pyx_t_5 = __pyx_t_4;
3979 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3980 __pyx_v_ebN_local = __pyx_t_6;
3989 __pyx_t_7 = __pyx_v_eN;
3990 __pyx_t_8 = __pyx_v_ebN_local;
3992 if (__pyx_t_7 < 0) {
3993 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3994 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3995 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
3996 if (__pyx_t_8 < 0) {
3997 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3998 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3999 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
4000 if (unlikely(__pyx_t_9 != -1)) {
4001 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4002 __PYX_ERR(0, 108, __pyx_L1_error)
4004 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
4013 __pyx_t_10 = __pyx_v_ebN;
4016 if (__pyx_t_10 < 0) {
4017 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4018 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
4019 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4020 if (__pyx_t_11 < 0) {
4021 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4022 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
4023 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4024 if (unlikely(__pyx_t_9 != -1)) {
4025 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4026 __PYX_ERR(0, 109, __pyx_L1_error)
4028 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4037 __pyx_t_12 = __pyx_v_ebN;
4040 if (__pyx_t_12 < 0) {
4041 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4042 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
4043 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4044 if (__pyx_t_13 < 0) {
4045 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4046 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
4047 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4048 if (unlikely(__pyx_t_9 != -1)) {
4049 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4050 __PYX_ERR(0, 110, __pyx_L1_error)
4052 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4061 __pyx_t_14 = (__pyx_v_ebq_vals->dimensions[2]);
4062 __pyx_t_15 = __pyx_t_14;
4063 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
4064 __pyx_v_k = __pyx_t_9;
4073 __pyx_t_16 = __pyx_v_nd;
4074 __pyx_t_17 = __pyx_t_16;
4075 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
4076 __pyx_v_I = __pyx_t_18;
4085 __pyx_t_19 = __pyx_v_nd;
4086 __pyx_t_20 = __pyx_t_19;
4087 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
4088 __pyx_v_J = __pyx_t_21;
4097 if (unlikely(__pyx_v_material_functions == Py_None)) {
4098 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4099 __PYX_ERR(0, 114, __pyx_L1_error)
4101 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4102 __Pyx_GOTREF(__pyx_t_22);
4103 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 114, __pyx_L1_error)
4104 __Pyx_GOTREF(__pyx_t_23);
4105 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4106 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4107 __Pyx_GOTREF(__pyx_t_22);
4108 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4109 __Pyx_GOTREF(__pyx_t_24);
4110 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 114, __pyx_L1_error)
4111 __Pyx_GOTREF(__pyx_t_25);
4112 __Pyx_GIVEREF(__pyx_t_22);
4113 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_22);
4114 __Pyx_GIVEREF(__pyx_t_24);
4115 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_24);
4118 __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_25);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4119 __Pyx_GOTREF(__pyx_t_24);
4120 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4121 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
4122 __pyx_t_25 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 114, __pyx_L1_error)
4123 __Pyx_GOTREF(__pyx_t_25);
4124 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4125 if (unlikely(__pyx_v_material_functions == Py_None)) {
4126 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4127 __PYX_ERR(0, 114, __pyx_L1_error)
4129 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4130 __Pyx_GOTREF(__pyx_t_24);
4131 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 114, __pyx_L1_error)
4132 __Pyx_GOTREF(__pyx_t_23);
4133 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4134 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 114, __pyx_L1_error)
4135 __Pyx_GOTREF(__pyx_t_24);
4136 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4137 __Pyx_GOTREF(__pyx_t_22);
4138 __pyx_t_26 = PyTuple_New(2);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 114, __pyx_L1_error)
4139 __Pyx_GOTREF(__pyx_t_26);
4140 __Pyx_GIVEREF(__pyx_t_24);
4141 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_24);
4142 __Pyx_GIVEREF(__pyx_t_22);
4143 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_22);
4146 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_26);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4147 __Pyx_GOTREF(__pyx_t_22);
4148 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4149 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4150 __pyx_t_26 = PyNumber_Multiply(__pyx_t_25, __pyx_t_22);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 114, __pyx_L1_error)
4151 __Pyx_GOTREF(__pyx_t_26);
4152 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
4153 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4154 __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_t_26);
if (unlikely((__pyx_t_27 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4155 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4156 __pyx_v_numer = __pyx_t_27;
4165 if (unlikely(__pyx_v_material_functions == Py_None)) {
4166 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4167 __PYX_ERR(0, 115, __pyx_L1_error)
4169 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4170 __Pyx_GOTREF(__pyx_t_26);
4171 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_26);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4172 __Pyx_GOTREF(__pyx_t_22);
4173 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4174 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4175 __Pyx_GOTREF(__pyx_t_26);
4176 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 115, __pyx_L1_error)
4177 __Pyx_GOTREF(__pyx_t_25);
4178 __pyx_t_23 = PyTuple_New(2);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 115, __pyx_L1_error)
4179 __Pyx_GOTREF(__pyx_t_23);
4180 __Pyx_GIVEREF(__pyx_t_26);
4181 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_26);
4182 __Pyx_GIVEREF(__pyx_t_25);
4183 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_25);
4186 __pyx_t_25 = __Pyx_PyObject_GetItem(__pyx_t_22, __pyx_t_23);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 115, __pyx_L1_error)
4187 __Pyx_GOTREF(__pyx_t_25);
4188 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4189 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4190 if (unlikely(__pyx_v_material_functions == Py_None)) {
4191 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4192 __PYX_ERR(0, 115, __pyx_L1_error)
4194 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 115, __pyx_L1_error)
4195 __Pyx_GOTREF(__pyx_t_23);
4196 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4197 __Pyx_GOTREF(__pyx_t_22);
4198 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
4199 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 115, __pyx_L1_error)
4200 __Pyx_GOTREF(__pyx_t_23);
4201 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4202 __Pyx_GOTREF(__pyx_t_26);
4203 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 115, __pyx_L1_error)
4204 __Pyx_GOTREF(__pyx_t_24);
4205 __Pyx_GIVEREF(__pyx_t_23);
4206 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_23);
4207 __Pyx_GIVEREF(__pyx_t_26);
4208 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_26);
4211 __pyx_t_26 = __Pyx_PyObject_GetItem(__pyx_t_22, __pyx_t_24);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4212 __Pyx_GOTREF(__pyx_t_26);
4213 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4214 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4215 __pyx_t_24 = PyNumber_Add(__pyx_t_25, __pyx_t_26);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 115, __pyx_L1_error)
4216 __Pyx_GOTREF(__pyx_t_24);
4217 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
4218 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4219 __pyx_t_26 = __Pyx_PyFloat_AddObjC(__pyx_t_24, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 115, __pyx_L1_error)
4220 __Pyx_GOTREF(__pyx_t_26);
4221 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
4222 __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_t_26);
if (unlikely((__pyx_t_27 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
4223 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
4224 __pyx_v_denom = __pyx_t_27;
4233 if (unlikely(__pyx_v_denom == 0)) {
4234 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4235 __PYX_ERR(0, 116, __pyx_L1_error)
4237 __pyx_t_28 = __pyx_v_eN;
4238 __pyx_t_29 = __pyx_v_ebN_local;
4239 __pyx_t_30 = __pyx_v_k;
4240 __pyx_t_31 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4242 if (__pyx_t_28 < 0) {
4243 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
4244 if (unlikely(__pyx_t_28 < 0)) __pyx_t_32 = 0;
4245 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_32 = 0;
4246 if (__pyx_t_29 < 0) {
4247 __pyx_t_29 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
4248 if (unlikely(__pyx_t_29 < 0)) __pyx_t_32 = 1;
4249 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_32 = 1;
4250 if (__pyx_t_30 < 0) {
4251 __pyx_t_30 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
4252 if (unlikely(__pyx_t_30 < 0)) __pyx_t_32 = 2;
4253 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_32 = 2;
4254 if (__pyx_t_31 < 0) {
4255 __pyx_t_31 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
4256 if (unlikely(__pyx_t_31 < 0)) __pyx_t_32 = 3;
4257 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_32 = 3;
4258 if (unlikely(__pyx_t_32 != -1)) {
4259 __Pyx_RaiseBufferIndexError(__pyx_t_32);
4260 __PYX_ERR(0, 116, __pyx_L1_error)
4262 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
4278 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4281 __Pyx_XDECREF(__pyx_t_22);
4282 __Pyx_XDECREF(__pyx_t_23);
4283 __Pyx_XDECREF(__pyx_t_24);
4284 __Pyx_XDECREF(__pyx_t_25);
4285 __Pyx_XDECREF(__pyx_t_26);
4286 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4287 __Pyx_PyThreadState_declare
4288 __Pyx_PyThreadState_assign
4289 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4290 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4291 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4292 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4293 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4294 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4298 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4299 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4300 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4302 __Pyx_XGIVEREF(__pyx_r);
4303 __Pyx_RefNannyFinishContext();
4316 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4317 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4318 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
4319 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4320 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4321 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4322 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4323 PyObject *__pyx_v_material_functions = 0;
4324 PyObject *__pyx_r = 0;
4325 __Pyx_RefNannyDeclarations
4326 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
4328 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4329 PyObject* values[4] = {0,0,0,0};
4330 if (unlikely(__pyx_kwds)) {
4332 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4334 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4336 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4338 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4340 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4343 default:
goto __pyx_L5_argtuple_error;
4345 kw_args = PyDict_Size(__pyx_kwds);
4348 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4349 else goto __pyx_L5_argtuple_error;
4352 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4354 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4358 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4360 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4364 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4366 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4369 if (unlikely(kw_args > 0)) {
4370 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4372 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4373 goto __pyx_L5_argtuple_error;
4375 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4376 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4377 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4378 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4380 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
4381 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
4382 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
4383 __pyx_v_material_functions = ((PyObject*)values[3]);
4385 goto __pyx_L4_argument_unpacking_done;
4386 __pyx_L5_argtuple_error:;
4387 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4389 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4390 __Pyx_RefNannyFinishContext();
4392 __pyx_L4_argument_unpacking_done:;
4393 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4394 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
4395 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
4396 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
4397 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4404 __Pyx_RefNannyFinishContext();
4408 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4410 int __pyx_v_material_left;
4411 int __pyx_v_material_right;
4413 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4414 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4415 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4416 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4417 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4418 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4419 PyObject *__pyx_r = NULL;
4420 __Pyx_RefNannyDeclarations
4424 Py_ssize_t __pyx_t_4;
4425 Py_ssize_t __pyx_t_5;
4427 Py_ssize_t __pyx_t_7;
4428 Py_ssize_t __pyx_t_8;
4430 npy_intp __pyx_t_10;
4431 npy_intp __pyx_t_11;
4432 PyObject *__pyx_t_12 = NULL;
4433 PyObject *__pyx_t_13 = NULL;
4434 PyObject *__pyx_t_14 = NULL;
4435 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
4436 Py_ssize_t __pyx_t_16;
4437 Py_ssize_t __pyx_t_17;
4438 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
4439 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4440 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4441 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4442 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4443 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4444 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4445 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4446 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4447 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4448 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4449 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4450 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4452 __Pyx_BufFmt_StackElem __pyx_stack[1];
4453 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4455 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4457 __Pyx_BufFmt_StackElem __pyx_stack[1];
4458 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4460 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4462 __Pyx_BufFmt_StackElem __pyx_stack[1];
4463 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4465 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
4474 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4475 __pyx_t_2 = __pyx_t_1;
4476 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4477 __pyx_v_ebN = __pyx_t_3;
4486 __pyx_t_4 = __pyx_v_ebN;
4489 if (__pyx_t_4 < 0) {
4490 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4491 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4492 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4493 if (__pyx_t_5 < 0) {
4494 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4495 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4496 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4497 if (unlikely(__pyx_t_6 != -1)) {
4498 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4499 __PYX_ERR(0, 132, __pyx_L1_error)
4501 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4510 __pyx_t_7 = __pyx_v_ebN;
4513 if (__pyx_t_7 < 0) {
4514 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4515 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
4516 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4517 if (__pyx_t_8 < 0) {
4518 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4519 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
4520 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4521 if (unlikely(__pyx_t_6 != -1)) {
4522 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4523 __PYX_ERR(0, 133, __pyx_L1_error)
4525 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4534 __pyx_t_9 = (__pyx_v_ebq_global_vals->dimensions[1]);
4535 __pyx_t_10 = __pyx_t_9;
4536 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
4537 __pyx_v_k = __pyx_t_11;
4546 if (unlikely(__pyx_v_material_functions == Py_None)) {
4547 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4548 __PYX_ERR(0, 135, __pyx_L1_error)
4550 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4551 __Pyx_GOTREF(__pyx_t_12);
4552 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 135, __pyx_L1_error)
4553 __Pyx_GOTREF(__pyx_t_13);
4554 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4563 if (unlikely(__pyx_v_material_functions == Py_None)) {
4564 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4565 __PYX_ERR(0, 136, __pyx_L1_error)
4567 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
4568 __Pyx_GOTREF(__pyx_t_12);
4569 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 136, __pyx_L1_error)
4570 __Pyx_GOTREF(__pyx_t_14);
4571 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4580 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4581 __Pyx_GOTREF(__pyx_t_12);
4582 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4583 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4584 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 135, __pyx_L1_error)
4585 __Pyx_GOTREF(__pyx_t_14);
4586 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4587 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4588 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4589 __pyx_t_16 = __pyx_v_ebN;
4590 __pyx_t_17 = __pyx_v_k;
4592 if (__pyx_t_16 < 0) {
4593 __pyx_t_16 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4594 if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
4595 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
4596 if (__pyx_t_17 < 0) {
4597 __pyx_t_17 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4598 if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 1;
4599 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
4600 if (unlikely(__pyx_t_6 != -1)) {
4601 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4602 __PYX_ERR(0, 135, __pyx_L1_error)
4604 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_15;
4617 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4620 __Pyx_XDECREF(__pyx_t_12);
4621 __Pyx_XDECREF(__pyx_t_13);
4622 __Pyx_XDECREF(__pyx_t_14);
4623 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4624 __Pyx_PyThreadState_declare
4625 __Pyx_PyThreadState_assign
4626 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4630 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4631 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4635 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4639 __Pyx_XGIVEREF(__pyx_r);
4640 __Pyx_RefNannyFinishContext();
4653 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4654 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4655 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4656 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4658 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4659 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4660 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4661 PyObject *__pyx_v_material_functions = 0;
4662 PyObject *__pyx_r = 0;
4663 __Pyx_RefNannyDeclarations
4664 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4666 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4667 PyObject* values[5] = {0,0,0,0,0};
4668 if (unlikely(__pyx_kwds)) {
4670 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4672 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4674 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4676 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4678 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4680 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4683 default:
goto __pyx_L5_argtuple_error;
4685 kw_args = PyDict_Size(__pyx_kwds);
4688 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4689 else goto __pyx_L5_argtuple_error;
4692 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4694 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 139, __pyx_L3_error)
4698 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4700 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 139, __pyx_L3_error)
4704 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4706 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 139, __pyx_L3_error)
4710 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4712 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 139, __pyx_L3_error)
4715 if (unlikely(kw_args > 0)) {
4716 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
4718 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4719 goto __pyx_L5_argtuple_error;
4721 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4722 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4723 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4724 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4725 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4727 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
4728 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4729 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4730 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4731 __pyx_v_material_functions = ((PyObject*)values[4]);
4733 goto __pyx_L4_argument_unpacking_done;
4734 __pyx_L5_argtuple_error:;
4735 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
4737 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4738 __Pyx_RefNannyFinishContext();
4740 __pyx_L4_argument_unpacking_done:;
4741 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
4742 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
4743 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
4744 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 143, __pyx_L1_error)
4745 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4752 __Pyx_RefNannyFinishContext();
4756 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4759 int __pyx_v_material_left;
4760 int __pyx_v_material_right;
4763 double __pyx_v_numer;
4764 double __pyx_v_denom;
4765 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4766 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4767 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4768 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4769 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4770 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4771 PyObject *__pyx_r = NULL;
4772 __Pyx_RefNannyDeclarations
4776 Py_ssize_t __pyx_t_4;
4777 Py_ssize_t __pyx_t_5;
4779 Py_ssize_t __pyx_t_7;
4780 Py_ssize_t __pyx_t_8;
4782 npy_intp __pyx_t_10;
4789 PyObject *__pyx_t_17 = NULL;
4790 PyObject *__pyx_t_18 = NULL;
4791 PyObject *__pyx_t_19 = NULL;
4792 PyObject *__pyx_t_20 = NULL;
4793 PyObject *__pyx_t_21 = NULL;
4795 Py_ssize_t __pyx_t_23;
4796 Py_ssize_t __pyx_t_24;
4797 Py_ssize_t __pyx_t_25;
4799 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4800 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4801 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4802 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4803 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4804 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4805 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4806 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4807 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4808 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4809 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4810 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4811 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4813 __Pyx_BufFmt_StackElem __pyx_stack[1];
4814 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4816 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4818 __Pyx_BufFmt_StackElem __pyx_stack[1];
4819 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4821 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4823 __Pyx_BufFmt_StackElem __pyx_stack[1];
4824 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4826 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
4835 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4836 __pyx_t_2 = __pyx_t_1;
4837 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4838 __pyx_v_ebN = __pyx_t_3;
4847 __pyx_t_4 = __pyx_v_ebN;
4850 if (__pyx_t_4 < 0) {
4851 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4852 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4853 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4854 if (__pyx_t_5 < 0) {
4855 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4856 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4857 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4858 if (unlikely(__pyx_t_6 != -1)) {
4859 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4860 __PYX_ERR(0, 155, __pyx_L1_error)
4862 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4871 __pyx_t_7 = __pyx_v_ebN;
4874 if (__pyx_t_7 < 0) {
4875 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4876 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
4877 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4878 if (__pyx_t_8 < 0) {
4879 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4880 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
4881 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4882 if (unlikely(__pyx_t_6 != -1)) {
4883 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4884 __PYX_ERR(0, 156, __pyx_L1_error)
4886 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4895 __pyx_t_9 = (__pyx_v_ebq_global_vals->dimensions[1]);
4896 __pyx_t_10 = __pyx_t_9;
4897 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_10; __pyx_t_6+=1) {
4898 __pyx_v_k = __pyx_t_6;
4907 __pyx_t_11 = __pyx_v_nd;
4908 __pyx_t_12 = __pyx_t_11;
4909 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
4910 __pyx_v_I = __pyx_t_13;
4919 __pyx_t_14 = __pyx_v_nd;
4920 __pyx_t_15 = __pyx_t_14;
4921 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
4922 __pyx_v_J = __pyx_t_16;
4931 if (unlikely(__pyx_v_material_functions == Py_None)) {
4932 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4933 __PYX_ERR(0, 160, __pyx_L1_error)
4935 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
4936 __Pyx_GOTREF(__pyx_t_17);
4937 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
4938 __Pyx_GOTREF(__pyx_t_18);
4939 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4940 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
4941 __Pyx_GOTREF(__pyx_t_17);
4942 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
4943 __Pyx_GOTREF(__pyx_t_19);
4944 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 160, __pyx_L1_error)
4945 __Pyx_GOTREF(__pyx_t_20);
4946 __Pyx_GIVEREF(__pyx_t_17);
4947 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
4948 __Pyx_GIVEREF(__pyx_t_19);
4949 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
4952 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
4953 __Pyx_GOTREF(__pyx_t_19);
4954 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4955 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4956 __pyx_t_20 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 160, __pyx_L1_error)
4957 __Pyx_GOTREF(__pyx_t_20);
4958 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4959 if (unlikely(__pyx_v_material_functions == Py_None)) {
4960 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4961 __PYX_ERR(0, 160, __pyx_L1_error)
4963 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
4964 __Pyx_GOTREF(__pyx_t_19);
4965 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
4966 __Pyx_GOTREF(__pyx_t_18);
4967 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4968 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
4969 __Pyx_GOTREF(__pyx_t_19);
4970 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
4971 __Pyx_GOTREF(__pyx_t_17);
4972 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 160, __pyx_L1_error)
4973 __Pyx_GOTREF(__pyx_t_21);
4974 __Pyx_GIVEREF(__pyx_t_19);
4975 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19);
4976 __Pyx_GIVEREF(__pyx_t_17);
4977 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_17);
4980 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_21);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
4981 __Pyx_GOTREF(__pyx_t_17);
4982 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4983 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4984 __pyx_t_21 = PyNumber_Multiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 160, __pyx_L1_error)
4985 __Pyx_GOTREF(__pyx_t_21);
4986 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4987 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4988 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4989 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4990 __pyx_v_numer = __pyx_t_22;
4999 if (unlikely(__pyx_v_material_functions == Py_None)) {
5000 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5001 __PYX_ERR(0, 161, __pyx_L1_error)
5003 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5004 __Pyx_GOTREF(__pyx_t_21);
5005 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_21);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5006 __Pyx_GOTREF(__pyx_t_17);
5007 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5008 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5009 __Pyx_GOTREF(__pyx_t_21);
5010 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 161, __pyx_L1_error)
5011 __Pyx_GOTREF(__pyx_t_20);
5012 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5013 __Pyx_GOTREF(__pyx_t_18);
5014 __Pyx_GIVEREF(__pyx_t_21);
5015 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_21);
5016 __Pyx_GIVEREF(__pyx_t_20);
5017 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
5020 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 161, __pyx_L1_error)
5021 __Pyx_GOTREF(__pyx_t_20);
5022 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5023 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5024 if (unlikely(__pyx_v_material_functions == Py_None)) {
5025 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5026 __PYX_ERR(0, 161, __pyx_L1_error)
5028 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5029 __Pyx_GOTREF(__pyx_t_18);
5030 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5031 __Pyx_GOTREF(__pyx_t_17);
5032 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5033 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5034 __Pyx_GOTREF(__pyx_t_18);
5035 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5036 __Pyx_GOTREF(__pyx_t_21);
5037 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5038 __Pyx_GOTREF(__pyx_t_19);
5039 __Pyx_GIVEREF(__pyx_t_18);
5040 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18);
5041 __Pyx_GIVEREF(__pyx_t_21);
5042 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
5045 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5046 __Pyx_GOTREF(__pyx_t_21);
5047 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5048 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5049 __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_t_21);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5050 __Pyx_GOTREF(__pyx_t_19);
5051 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5052 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5053 __pyx_t_21 = __Pyx_PyFloat_AddObjC(__pyx_t_19, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
5054 __Pyx_GOTREF(__pyx_t_21);
5055 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5056 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5057 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5058 __pyx_v_denom = __pyx_t_22;
5067 if (unlikely(__pyx_v_denom == 0)) {
5068 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
5069 __PYX_ERR(0, 162, __pyx_L1_error)
5071 __pyx_t_23 = __pyx_v_ebN;
5072 __pyx_t_24 = __pyx_v_k;
5073 __pyx_t_25 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
5075 if (__pyx_t_23 < 0) {
5076 __pyx_t_23 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
5077 if (unlikely(__pyx_t_23 < 0)) __pyx_t_26 = 0;
5078 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_26 = 0;
5079 if (__pyx_t_24 < 0) {
5080 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
5081 if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 1;
5082 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_26 = 1;
5083 if (__pyx_t_25 < 0) {
5084 __pyx_t_25 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
5085 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 2;
5086 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_26 = 2;
5087 if (unlikely(__pyx_t_26 != -1)) {
5088 __Pyx_RaiseBufferIndexError(__pyx_t_26);
5089 __PYX_ERR(0, 162, __pyx_L1_error)
5091 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
5106 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5109 __Pyx_XDECREF(__pyx_t_17);
5110 __Pyx_XDECREF(__pyx_t_18);
5111 __Pyx_XDECREF(__pyx_t_19);
5112 __Pyx_XDECREF(__pyx_t_20);
5113 __Pyx_XDECREF(__pyx_t_21);
5114 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5115 __Pyx_PyThreadState_declare
5116 __Pyx_PyThreadState_assign
5117 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5118 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5119 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5120 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5121 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5122 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5126 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5127 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5128 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5130 __Pyx_XGIVEREF(__pyx_r);
5131 __Pyx_RefNannyFinishContext();
5144 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5145 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
5146 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
5147 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5149 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5150 PyArrayObject *__pyx_v_x = 0;
5151 PyArrayObject *__pyx_v_q_vals = 0;
5152 PyObject *__pyx_v_material_functions = 0;
5153 PyObject *__pyx_r = 0;
5154 __Pyx_RefNannyDeclarations
5155 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
5157 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5158 PyObject* values[5] = {0,0,0,0,0};
5159 if (unlikely(__pyx_kwds)) {
5161 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5163 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5165 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5167 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5169 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5171 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5174 default:
goto __pyx_L5_argtuple_error;
5176 kw_args = PyDict_Size(__pyx_kwds);
5179 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5180 else goto __pyx_L5_argtuple_error;
5183 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5185 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
5189 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5191 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
5195 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5197 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
5201 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5203 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
5206 if (unlikely(kw_args > 0)) {
5207 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
5209 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5210 goto __pyx_L5_argtuple_error;
5212 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5213 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5214 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5215 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5216 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5218 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error)
5219 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5220 __pyx_v_x = ((PyArrayObject *)values[2]);
5221 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5222 __pyx_v_material_functions = ((PyObject*)values[4]);
5224 goto __pyx_L4_argument_unpacking_done;
5225 __pyx_L5_argtuple_error:;
5226 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
5228 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5229 __Pyx_RefNannyFinishContext();
5231 __pyx_L4_argument_unpacking_done:;
5232 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
5233 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
5234 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
5235 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 169, __pyx_L1_error)
5236 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5243 __Pyx_RefNannyFinishContext();
5247 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5250 int __pyx_v_material;
5251 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5252 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5253 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5254 __Pyx_Buffer __pyx_pybuffer_q_vals;
5255 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5256 __Pyx_Buffer __pyx_pybuffer_x;
5257 PyObject *__pyx_r = NULL;
5258 __Pyx_RefNannyDeclarations
5262 Py_ssize_t __pyx_t_4;
5266 PyObject *__pyx_t_8 = NULL;
5267 PyObject *__pyx_t_9 = NULL;
5268 PyObject *__pyx_t_10 = NULL;
5269 PyObject *__pyx_t_11 = NULL;
5270 PyObject *__pyx_t_12 = NULL;
5272 PyObject *__pyx_t_14 = NULL;
5273 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
5274 Py_ssize_t __pyx_t_16;
5275 Py_ssize_t __pyx_t_17;
5276 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
5277 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5278 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5279 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5280 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5281 __pyx_pybuffer_x.pybuffer.buf = NULL;
5282 __pyx_pybuffer_x.refcount = 0;
5283 __pyx_pybuffernd_x.data = NULL;
5284 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5285 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5286 __pyx_pybuffer_q_vals.refcount = 0;
5287 __pyx_pybuffernd_q_vals.data = NULL;
5288 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5290 __Pyx_BufFmt_StackElem __pyx_stack[1];
5291 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5293 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5295 __Pyx_BufFmt_StackElem __pyx_stack[1];
5296 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5298 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5300 __Pyx_BufFmt_StackElem __pyx_stack[1];
5301 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5303 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
5312 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5313 __pyx_t_2 = __pyx_t_1;
5314 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5315 __pyx_v_eN = __pyx_t_3;
5324 __pyx_t_4 = __pyx_v_eN;
5326 if (__pyx_t_4 < 0) {
5327 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5328 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5329 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5330 if (unlikely(__pyx_t_5 != -1)) {
5331 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5332 __PYX_ERR(0, 176, __pyx_L1_error)
5334 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5343 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5344 __pyx_t_7 = __pyx_t_6;
5345 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5346 __pyx_v_k = __pyx_t_5;
5355 if (unlikely(__pyx_v_material_functions == Py_None)) {
5356 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5357 __PYX_ERR(0, 178, __pyx_L1_error)
5359 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5360 __Pyx_GOTREF(__pyx_t_9);
5361 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5362 __Pyx_GOTREF(__pyx_t_10);
5363 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5364 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5365 __Pyx_GOTREF(__pyx_t_9);
5366 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5367 __Pyx_GOTREF(__pyx_t_11);
5368 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5369 __Pyx_GOTREF(__pyx_t_12);
5370 __Pyx_GIVEREF(__pyx_t_9);
5371 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5372 __Pyx_GIVEREF(__pyx_t_11);
5373 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5376 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5377 __Pyx_GOTREF(__pyx_t_11);
5378 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5379 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5380 __Pyx_GOTREF(__pyx_t_12);
5383 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5384 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5385 if (likely(__pyx_t_9)) {
5386 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5387 __Pyx_INCREF(__pyx_t_9);
5388 __Pyx_INCREF(
function);
5389 __Pyx_DECREF_SET(__pyx_t_10,
function);
5393 #if CYTHON_FAST_PYCALL
5394 if (PyFunction_Check(__pyx_t_10)) {
5395 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5396 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5397 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5398 __Pyx_GOTREF(__pyx_t_8);
5399 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5400 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5403 #if CYTHON_FAST_PYCCALL
5404 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5405 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5406 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5407 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5408 __Pyx_GOTREF(__pyx_t_8);
5409 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5410 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5414 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 178, __pyx_L1_error)
5415 __Pyx_GOTREF(__pyx_t_14);
5417 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5419 __Pyx_GIVEREF(__pyx_t_11);
5420 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5421 __Pyx_GIVEREF(__pyx_t_12);
5422 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5425 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5426 __Pyx_GOTREF(__pyx_t_8);
5427 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5429 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5430 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5431 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5432 __pyx_t_16 = __pyx_v_eN;
5433 __pyx_t_17 = __pyx_v_k;
5435 if (__pyx_t_16 < 0) {
5436 __pyx_t_16 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
5437 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 0;
5438 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
5439 if (__pyx_t_17 < 0) {
5440 __pyx_t_17 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
5441 if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 1;
5442 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
5443 if (unlikely(__pyx_t_13 != -1)) {
5444 __Pyx_RaiseBufferIndexError(__pyx_t_13);
5445 __PYX_ERR(0, 178, __pyx_L1_error)
5447 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_15;
5460 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5463 __Pyx_XDECREF(__pyx_t_8);
5464 __Pyx_XDECREF(__pyx_t_9);
5465 __Pyx_XDECREF(__pyx_t_10);
5466 __Pyx_XDECREF(__pyx_t_11);
5467 __Pyx_XDECREF(__pyx_t_12);
5468 __Pyx_XDECREF(__pyx_t_14);
5469 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5470 __Pyx_PyThreadState_declare
5471 __Pyx_PyThreadState_assign
5472 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5473 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5474 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5475 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5476 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5477 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5481 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5482 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5483 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5485 __Pyx_XGIVEREF(__pyx_r);
5486 __Pyx_RefNannyFinishContext();
5499 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5500 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
5501 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
5502 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5504 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5505 PyArrayObject *__pyx_v_x = 0;
5506 PyArrayObject *__pyx_v_q_vals = 0;
5507 PyObject *__pyx_v_material_functions = 0;
5508 PyObject *__pyx_r = 0;
5509 __Pyx_RefNannyDeclarations
5510 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
5512 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5513 PyObject* values[5] = {0,0,0,0,0};
5514 if (unlikely(__pyx_kwds)) {
5516 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5518 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5520 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5522 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5524 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5526 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5529 default:
goto __pyx_L5_argtuple_error;
5531 kw_args = PyDict_Size(__pyx_kwds);
5534 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5535 else goto __pyx_L5_argtuple_error;
5538 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5540 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
5544 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5546 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error)
5550 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5552 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error)
5556 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5558 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error)
5561 if (unlikely(kw_args > 0)) {
5562 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
5564 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5565 goto __pyx_L5_argtuple_error;
5567 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5568 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5569 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5570 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5571 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5573 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error)
5574 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5575 __pyx_v_x = ((PyArrayObject *)values[2]);
5576 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5577 __pyx_v_material_functions = ((PyObject*)values[4]);
5579 goto __pyx_L4_argument_unpacking_done;
5580 __pyx_L5_argtuple_error:;
5581 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
5583 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5584 __Pyx_RefNannyFinishContext();
5586 __pyx_L4_argument_unpacking_done:;
5587 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
5588 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
5589 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
5590 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 184, __pyx_L1_error)
5591 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5598 __Pyx_RefNannyFinishContext();
5602 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5605 int __pyx_v_material;
5606 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5607 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5608 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5609 __Pyx_Buffer __pyx_pybuffer_q_vals;
5610 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5611 __Pyx_Buffer __pyx_pybuffer_x;
5612 PyObject *__pyx_r = NULL;
5613 __Pyx_RefNannyDeclarations
5617 Py_ssize_t __pyx_t_4;
5621 PyObject *__pyx_t_8 = NULL;
5622 PyObject *__pyx_t_9 = NULL;
5623 PyObject *__pyx_t_10 = NULL;
5624 PyObject *__pyx_t_11 = NULL;
5625 PyObject *__pyx_t_12 = NULL;
5627 PyObject *__pyx_t_14 = NULL;
5628 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5629 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5630 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5631 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5632 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5633 __pyx_pybuffer_x.pybuffer.buf = NULL;
5634 __pyx_pybuffer_x.refcount = 0;
5635 __pyx_pybuffernd_x.data = NULL;
5636 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5637 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5638 __pyx_pybuffer_q_vals.refcount = 0;
5639 __pyx_pybuffernd_q_vals.data = NULL;
5640 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5642 __Pyx_BufFmt_StackElem __pyx_stack[1];
5643 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5645 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5647 __Pyx_BufFmt_StackElem __pyx_stack[1];
5648 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5650 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5652 __Pyx_BufFmt_StackElem __pyx_stack[1];
5653 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5655 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5664 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5665 __pyx_t_2 = __pyx_t_1;
5666 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5667 __pyx_v_eN = __pyx_t_3;
5676 __pyx_t_4 = __pyx_v_eN;
5678 if (__pyx_t_4 < 0) {
5679 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5680 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5681 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5682 if (unlikely(__pyx_t_5 != -1)) {
5683 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5684 __PYX_ERR(0, 190, __pyx_L1_error)
5686 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5695 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5696 __pyx_t_7 = __pyx_t_6;
5697 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5698 __pyx_v_k = __pyx_t_5;
5707 if (unlikely(__pyx_v_material_functions == Py_None)) {
5708 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5709 __PYX_ERR(0, 192, __pyx_L1_error)
5711 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5712 __Pyx_GOTREF(__pyx_t_9);
5713 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5714 __Pyx_GOTREF(__pyx_t_10);
5715 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5716 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5717 __Pyx_GOTREF(__pyx_t_9);
5718 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5719 __Pyx_GOTREF(__pyx_t_11);
5720 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5721 __Pyx_GOTREF(__pyx_t_12);
5722 __Pyx_GIVEREF(__pyx_t_9);
5723 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5724 __Pyx_GIVEREF(__pyx_t_11);
5725 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5728 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5729 __Pyx_GOTREF(__pyx_t_11);
5730 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5731 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5732 __Pyx_GOTREF(__pyx_t_12);
5735 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5736 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5737 if (likely(__pyx_t_9)) {
5738 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5739 __Pyx_INCREF(__pyx_t_9);
5740 __Pyx_INCREF(
function);
5741 __Pyx_DECREF_SET(__pyx_t_10,
function);
5745 #if CYTHON_FAST_PYCALL
5746 if (PyFunction_Check(__pyx_t_10)) {
5747 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5748 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5749 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5750 __Pyx_GOTREF(__pyx_t_8);
5751 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5752 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5755 #if CYTHON_FAST_PYCCALL
5756 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5757 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5758 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5759 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5760 __Pyx_GOTREF(__pyx_t_8);
5761 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5762 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5766 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5767 __Pyx_GOTREF(__pyx_t_14);
5769 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5771 __Pyx_GIVEREF(__pyx_t_11);
5772 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5773 __Pyx_GIVEREF(__pyx_t_12);
5774 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5777 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5778 __Pyx_GOTREF(__pyx_t_8);
5779 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5781 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5782 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5783 __Pyx_GOTREF(__pyx_t_10);
5784 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5785 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5786 __Pyx_GOTREF(__pyx_t_8);
5787 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5788 __Pyx_GOTREF(__pyx_t_14);
5789 __pyx_t_12 = PyTuple_New(3);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5790 __Pyx_GOTREF(__pyx_t_12);
5791 __Pyx_GIVEREF(__pyx_t_8);
5792 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
5793 __Pyx_GIVEREF(__pyx_t_14);
5794 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
5795 __Pyx_INCREF(__pyx_slice__2);
5796 __Pyx_GIVEREF(__pyx_slice__2);
5797 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice__2);
5800 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_12, __pyx_t_10) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5801 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5802 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5815 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5818 __Pyx_XDECREF(__pyx_t_8);
5819 __Pyx_XDECREF(__pyx_t_9);
5820 __Pyx_XDECREF(__pyx_t_10);
5821 __Pyx_XDECREF(__pyx_t_11);
5822 __Pyx_XDECREF(__pyx_t_12);
5823 __Pyx_XDECREF(__pyx_t_14);
5824 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5825 __Pyx_PyThreadState_declare
5826 __Pyx_PyThreadState_assign
5827 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5828 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5829 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5830 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5831 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5832 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5836 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5837 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5838 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5840 __Pyx_XGIVEREF(__pyx_r);
5841 __Pyx_RefNannyFinishContext();
5854 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5855 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5856 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
5857 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5859 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5860 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5861 PyArrayObject *__pyx_v_x = 0;
5862 PyArrayObject *__pyx_v_ebq_vals = 0;
5863 PyObject *__pyx_v_material_functions = 0;
5864 PyObject *__pyx_r = 0;
5865 __Pyx_RefNannyDeclarations
5866 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
5868 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5869 PyObject* values[6] = {0,0,0,0,0,0};
5870 if (unlikely(__pyx_kwds)) {
5872 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5874 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5876 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5878 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5880 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5887 default:
goto __pyx_L5_argtuple_error;
5889 kw_args = PyDict_Size(__pyx_kwds);
5892 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5893 else goto __pyx_L5_argtuple_error;
5896 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
5898 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 195, __pyx_L3_error)
5902 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
5904 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 195, __pyx_L3_error)
5908 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5910 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 195, __pyx_L3_error)
5914 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
5916 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 195, __pyx_L3_error)
5920 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5922 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 195, __pyx_L3_error)
5925 if (unlikely(kw_args > 0)) {
5926 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
5928 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5929 goto __pyx_L5_argtuple_error;
5931 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5932 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5933 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5934 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5935 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5936 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5938 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
5939 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
5940 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
5941 __pyx_v_x = ((PyArrayObject *)values[3]);
5942 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
5943 __pyx_v_material_functions = ((PyObject*)values[5]);
5945 goto __pyx_L4_argument_unpacking_done;
5946 __pyx_L5_argtuple_error:;
5947 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
5949 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5950 __Pyx_RefNannyFinishContext();
5952 __pyx_L4_argument_unpacking_done:;
5953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
5954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
5955 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
5956 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
5957 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 200, __pyx_L1_error)
5958 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
5965 __Pyx_RefNannyFinishContext();
5969 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
5972 int __pyx_v_ebN_local;
5974 int __pyx_v_material_left;
5975 int __pyx_v_material_right;
5976 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
5977 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
5978 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
5979 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
5980 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
5981 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
5982 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5983 __Pyx_Buffer __pyx_pybuffer_x;
5984 PyObject *__pyx_r = NULL;
5985 __Pyx_RefNannyDeclarations
5992 Py_ssize_t __pyx_t_7;
5993 Py_ssize_t __pyx_t_8;
5995 Py_ssize_t __pyx_t_10;
5996 Py_ssize_t __pyx_t_11;
5997 Py_ssize_t __pyx_t_12;
5998 Py_ssize_t __pyx_t_13;
5999 npy_intp __pyx_t_14;
6000 npy_intp __pyx_t_15;
6001 PyObject *__pyx_t_16 = NULL;
6002 PyObject *__pyx_t_17 = NULL;
6003 PyObject *__pyx_t_18 = NULL;
6004 PyObject *__pyx_t_19 = NULL;
6005 PyObject *__pyx_t_20 = NULL;
6006 PyObject *__pyx_t_21 = NULL;
6008 PyObject *__pyx_t_23 = NULL;
6009 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_24;
6010 Py_ssize_t __pyx_t_25;
6011 Py_ssize_t __pyx_t_26;
6012 Py_ssize_t __pyx_t_27;
6013 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
6014 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6015 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6016 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6017 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6018 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6019 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6020 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6021 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6022 __pyx_pybuffer_x.pybuffer.buf = NULL;
6023 __pyx_pybuffer_x.refcount = 0;
6024 __pyx_pybuffernd_x.data = NULL;
6025 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6026 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6027 __pyx_pybuffer_ebq_vals.refcount = 0;
6028 __pyx_pybuffernd_ebq_vals.data = NULL;
6029 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6031 __Pyx_BufFmt_StackElem __pyx_stack[1];
6032 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6034 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6036 __Pyx_BufFmt_StackElem __pyx_stack[1];
6037 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6039 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6041 __Pyx_BufFmt_StackElem __pyx_stack[1];
6042 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6044 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6046 __Pyx_BufFmt_StackElem __pyx_stack[1];
6047 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6049 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
6058 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6059 __pyx_t_2 = __pyx_t_1;
6060 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6061 __pyx_v_eN = __pyx_t_3;
6070 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6071 __pyx_t_5 = __pyx_t_4;
6072 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6073 __pyx_v_ebN_local = __pyx_t_6;
6082 __pyx_t_7 = __pyx_v_eN;
6083 __pyx_t_8 = __pyx_v_ebN_local;
6085 if (__pyx_t_7 < 0) {
6086 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6087 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6088 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6089 if (__pyx_t_8 < 0) {
6090 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6091 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6092 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6093 if (unlikely(__pyx_t_9 != -1)) {
6094 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6095 __PYX_ERR(0, 212, __pyx_L1_error)
6097 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6106 __pyx_t_10 = __pyx_v_ebN;
6109 if (__pyx_t_10 < 0) {
6110 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6111 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
6112 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6113 if (__pyx_t_11 < 0) {
6114 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6115 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
6116 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6117 if (unlikely(__pyx_t_9 != -1)) {
6118 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6119 __PYX_ERR(0, 213, __pyx_L1_error)
6121 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6130 __pyx_t_12 = __pyx_v_ebN;
6133 if (__pyx_t_12 < 0) {
6134 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6135 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
6136 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6137 if (__pyx_t_13 < 0) {
6138 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6139 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
6140 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6141 if (unlikely(__pyx_t_9 != -1)) {
6142 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6143 __PYX_ERR(0, 214, __pyx_L1_error)
6145 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6154 __pyx_t_14 = (__pyx_v_x->dimensions[2]);
6155 __pyx_t_15 = __pyx_t_14;
6156 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
6157 __pyx_v_k = __pyx_t_9;
6166 if (unlikely(__pyx_v_material_functions == Py_None)) {
6167 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6168 __PYX_ERR(0, 216, __pyx_L1_error)
6170 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6171 __Pyx_GOTREF(__pyx_t_17);
6172 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
6173 __Pyx_GOTREF(__pyx_t_18);
6174 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6175 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6176 __Pyx_GOTREF(__pyx_t_17);
6177 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 216, __pyx_L1_error)
6178 __Pyx_GOTREF(__pyx_t_19);
6179 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 216, __pyx_L1_error)
6180 __Pyx_GOTREF(__pyx_t_20);
6181 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L1_error)
6182 __Pyx_GOTREF(__pyx_t_21);
6183 __Pyx_GIVEREF(__pyx_t_17);
6184 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_17);
6185 __Pyx_GIVEREF(__pyx_t_19);
6186 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
6187 __Pyx_GIVEREF(__pyx_t_20);
6188 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_20);
6192 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 216, __pyx_L1_error)
6193 __Pyx_GOTREF(__pyx_t_20);
6194 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6195 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L1_error)
6196 __Pyx_GOTREF(__pyx_t_21);
6199 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) {
6200 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
6201 if (likely(__pyx_t_19)) {
6202 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_18);
6203 __Pyx_INCREF(__pyx_t_19);
6204 __Pyx_INCREF(
function);
6205 __Pyx_DECREF_SET(__pyx_t_18,
function);
6209 #if CYTHON_FAST_PYCALL
6210 if (PyFunction_Check(__pyx_t_18)) {
6211 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
6212 __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6213 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6214 __Pyx_GOTREF(__pyx_t_16);
6215 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6216 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6219 #if CYTHON_FAST_PYCCALL
6220 if (__Pyx_PyFastCFunction_Check(__pyx_t_18)) {
6221 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
6222 __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6223 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6224 __Pyx_GOTREF(__pyx_t_16);
6225 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6226 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6230 __pyx_t_17 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_17);
6233 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19); __pyx_t_19 = NULL;
6235 __Pyx_GIVEREF(__pyx_t_20);
6236 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_22, __pyx_t_20);
6237 __Pyx_GIVEREF(__pyx_t_21);
6238 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_22, __pyx_t_21);
6241 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6242 __Pyx_GOTREF(__pyx_t_16);
6243 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6245 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6254 if (unlikely(__pyx_v_material_functions == Py_None)) {
6255 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6256 __PYX_ERR(0, 217, __pyx_L1_error)
6258 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6259 __Pyx_GOTREF(__pyx_t_17);
6260 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 217, __pyx_L1_error)
6261 __Pyx_GOTREF(__pyx_t_21);
6262 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6263 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6264 __Pyx_GOTREF(__pyx_t_17);
6265 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 217, __pyx_L1_error)
6266 __Pyx_GOTREF(__pyx_t_20);
6267 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6268 __Pyx_GOTREF(__pyx_t_19);
6269 __pyx_t_23 = PyTuple_New(3);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 217, __pyx_L1_error)
6270 __Pyx_GOTREF(__pyx_t_23);
6271 __Pyx_GIVEREF(__pyx_t_17);
6272 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_17);
6273 __Pyx_GIVEREF(__pyx_t_20);
6274 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_20);
6275 __Pyx_GIVEREF(__pyx_t_19);
6276 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_19);
6280 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_23);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6281 __Pyx_GOTREF(__pyx_t_19);
6282 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6283 __pyx_t_23 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 217, __pyx_L1_error)
6284 __Pyx_GOTREF(__pyx_t_23);
6287 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
6288 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_21);
6289 if (likely(__pyx_t_20)) {
6290 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_21);
6291 __Pyx_INCREF(__pyx_t_20);
6292 __Pyx_INCREF(
function);
6293 __Pyx_DECREF_SET(__pyx_t_21,
function);
6297 #if CYTHON_FAST_PYCALL
6298 if (PyFunction_Check(__pyx_t_21)) {
6299 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_23};
6300 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
6301 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6302 __Pyx_GOTREF(__pyx_t_18);
6303 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6304 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6307 #if CYTHON_FAST_PYCCALL
6308 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
6309 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_23};
6310 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
6311 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6312 __Pyx_GOTREF(__pyx_t_18);
6313 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6314 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6318 __pyx_t_17 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6319 __Pyx_GOTREF(__pyx_t_17);
6321 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_20); __pyx_t_20 = NULL;
6323 __Pyx_GIVEREF(__pyx_t_19);
6324 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_22, __pyx_t_19);
6325 __Pyx_GIVEREF(__pyx_t_23);
6326 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_22, __pyx_t_23);
6329 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
6330 __Pyx_GOTREF(__pyx_t_18);
6331 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6333 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6342 __pyx_t_21 = PyNumber_Add(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 216, __pyx_L1_error)
6343 __Pyx_GOTREF(__pyx_t_21);
6344 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6345 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6346 __pyx_t_18 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_21);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
6347 __Pyx_GOTREF(__pyx_t_18);
6348 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6349 __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_24 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
6350 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6351 __pyx_t_25 = __pyx_v_eN;
6352 __pyx_t_26 = __pyx_v_ebN_local;
6353 __pyx_t_27 = __pyx_v_k;
6355 if (__pyx_t_25 < 0) {
6356 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6357 if (unlikely(__pyx_t_25 < 0)) __pyx_t_22 = 0;
6358 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_22 = 0;
6359 if (__pyx_t_26 < 0) {
6360 __pyx_t_26 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6361 if (unlikely(__pyx_t_26 < 0)) __pyx_t_22 = 1;
6362 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_22 = 1;
6363 if (__pyx_t_27 < 0) {
6364 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6365 if (unlikely(__pyx_t_27 < 0)) __pyx_t_22 = 2;
6366 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_22 = 2;
6367 if (unlikely(__pyx_t_22 != -1)) {
6368 __Pyx_RaiseBufferIndexError(__pyx_t_22);
6369 __PYX_ERR(0, 216, __pyx_L1_error)
6371 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_24;
6385 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6388 __Pyx_XDECREF(__pyx_t_16);
6389 __Pyx_XDECREF(__pyx_t_17);
6390 __Pyx_XDECREF(__pyx_t_18);
6391 __Pyx_XDECREF(__pyx_t_19);
6392 __Pyx_XDECREF(__pyx_t_20);
6393 __Pyx_XDECREF(__pyx_t_21);
6394 __Pyx_XDECREF(__pyx_t_23);
6395 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6396 __Pyx_PyThreadState_declare
6397 __Pyx_PyThreadState_assign
6398 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6399 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6400 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6401 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6402 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6403 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6404 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6408 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6409 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6410 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6411 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6413 __Pyx_XGIVEREF(__pyx_r);
6414 __Pyx_RefNannyFinishContext();
6427 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6428 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6429 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
6430 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6433 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6434 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6435 PyArrayObject *__pyx_v_x = 0;
6436 PyArrayObject *__pyx_v_ebq_vals = 0;
6437 PyObject *__pyx_v_material_functions = 0;
6438 PyObject *__pyx_r = 0;
6439 __Pyx_RefNannyDeclarations
6440 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
6442 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6443 PyObject* values[7] = {0,0,0,0,0,0,0};
6444 if (unlikely(__pyx_kwds)) {
6446 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6448 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6450 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6452 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6454 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6456 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6458 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6460 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6463 default:
goto __pyx_L5_argtuple_error;
6465 kw_args = PyDict_Size(__pyx_kwds);
6468 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
6469 else goto __pyx_L5_argtuple_error;
6472 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6474 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 219, __pyx_L3_error)
6478 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6480 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 219, __pyx_L3_error)
6484 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6486 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 219, __pyx_L3_error)
6490 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6492 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 219, __pyx_L3_error)
6496 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6498 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 219, __pyx_L3_error)
6502 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6504 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 219, __pyx_L3_error)
6507 if (unlikely(kw_args > 0)) {
6508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
6510 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
6511 goto __pyx_L5_argtuple_error;
6513 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6514 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6515 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6516 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6517 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6518 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6519 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6521 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error)
6522 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
6523 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
6524 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
6525 __pyx_v_x = ((PyArrayObject *)values[4]);
6526 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
6527 __pyx_v_material_functions = ((PyObject*)values[6]);
6529 goto __pyx_L4_argument_unpacking_done;
6530 __pyx_L5_argtuple_error:;
6531 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
6533 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6534 __Pyx_RefNannyFinishContext();
6536 __pyx_L4_argument_unpacking_done:;
6537 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
6538 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6539 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
6540 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6541 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 225, __pyx_L1_error)
6542 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6549 __Pyx_RefNannyFinishContext();
6553 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6556 int __pyx_v_ebN_local;
6558 int __pyx_v_material_left;
6559 int __pyx_v_material_right;
6562 double __pyx_v_numer;
6563 double __pyx_v_denom;
6564 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6565 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6566 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6567 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6568 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6569 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6570 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6571 __Pyx_Buffer __pyx_pybuffer_x;
6572 PyObject *__pyx_r = NULL;
6573 __Pyx_RefNannyDeclarations
6580 Py_ssize_t __pyx_t_7;
6581 Py_ssize_t __pyx_t_8;
6583 Py_ssize_t __pyx_t_10;
6584 Py_ssize_t __pyx_t_11;
6585 Py_ssize_t __pyx_t_12;
6586 Py_ssize_t __pyx_t_13;
6587 npy_intp __pyx_t_14;
6588 npy_intp __pyx_t_15;
6595 PyObject *__pyx_t_22 = NULL;
6596 PyObject *__pyx_t_23 = NULL;
6597 PyObject *__pyx_t_24 = NULL;
6598 PyObject *__pyx_t_25 = NULL;
6599 PyObject *__pyx_t_26 = NULL;
6600 PyObject *__pyx_t_27 = NULL;
6602 PyObject *__pyx_t_29 = NULL;
6604 Py_ssize_t __pyx_t_31;
6605 Py_ssize_t __pyx_t_32;
6606 Py_ssize_t __pyx_t_33;
6607 Py_ssize_t __pyx_t_34;
6608 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
6609 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6610 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6611 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6612 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6613 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6614 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6615 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6616 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6617 __pyx_pybuffer_x.pybuffer.buf = NULL;
6618 __pyx_pybuffer_x.refcount = 0;
6619 __pyx_pybuffernd_x.data = NULL;
6620 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6621 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6622 __pyx_pybuffer_ebq_vals.refcount = 0;
6623 __pyx_pybuffernd_ebq_vals.data = NULL;
6624 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6626 __Pyx_BufFmt_StackElem __pyx_stack[1];
6627 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6629 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6631 __Pyx_BufFmt_StackElem __pyx_stack[1];
6632 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6634 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6636 __Pyx_BufFmt_StackElem __pyx_stack[1];
6637 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6639 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6641 __Pyx_BufFmt_StackElem __pyx_stack[1];
6642 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6644 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
6653 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6654 __pyx_t_2 = __pyx_t_1;
6655 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6656 __pyx_v_eN = __pyx_t_3;
6665 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6666 __pyx_t_5 = __pyx_t_4;
6667 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6668 __pyx_v_ebN_local = __pyx_t_6;
6677 __pyx_t_7 = __pyx_v_eN;
6678 __pyx_t_8 = __pyx_v_ebN_local;
6680 if (__pyx_t_7 < 0) {
6681 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6682 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6683 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6684 if (__pyx_t_8 < 0) {
6685 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6686 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6687 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6688 if (unlikely(__pyx_t_9 != -1)) {
6689 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6690 __PYX_ERR(0, 238, __pyx_L1_error)
6692 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6701 __pyx_t_10 = __pyx_v_ebN;
6704 if (__pyx_t_10 < 0) {
6705 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6706 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
6707 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6708 if (__pyx_t_11 < 0) {
6709 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6710 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
6711 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6712 if (unlikely(__pyx_t_9 != -1)) {
6713 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6714 __PYX_ERR(0, 239, __pyx_L1_error)
6716 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6725 __pyx_t_12 = __pyx_v_ebN;
6728 if (__pyx_t_12 < 0) {
6729 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6730 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
6731 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6732 if (__pyx_t_13 < 0) {
6733 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6734 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
6735 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6736 if (unlikely(__pyx_t_9 != -1)) {
6737 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6738 __PYX_ERR(0, 240, __pyx_L1_error)
6740 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6749 __pyx_t_14 = (__pyx_v_x->dimensions[2]);
6750 __pyx_t_15 = __pyx_t_14;
6751 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
6752 __pyx_v_k = __pyx_t_9;
6761 __pyx_t_16 = __pyx_v_nd;
6762 __pyx_t_17 = __pyx_t_16;
6763 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
6764 __pyx_v_I = __pyx_t_18;
6773 __pyx_t_19 = __pyx_v_nd;
6774 __pyx_t_20 = __pyx_t_19;
6775 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
6776 __pyx_v_J = __pyx_t_21;
6785 if (unlikely(__pyx_v_material_functions == Py_None)) {
6786 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6787 __PYX_ERR(0, 244, __pyx_L1_error)
6789 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6790 __Pyx_GOTREF(__pyx_t_23);
6791 __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_23);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6792 __Pyx_GOTREF(__pyx_t_24);
6793 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6794 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6795 __Pyx_GOTREF(__pyx_t_23);
6796 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
6797 __Pyx_GOTREF(__pyx_t_25);
6798 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 244, __pyx_L1_error)
6799 __Pyx_GOTREF(__pyx_t_26);
6800 __pyx_t_27 = PyTuple_New(3);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6801 __Pyx_GOTREF(__pyx_t_27);
6802 __Pyx_GIVEREF(__pyx_t_23);
6803 PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_23);
6804 __Pyx_GIVEREF(__pyx_t_25);
6805 PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_25);
6806 __Pyx_GIVEREF(__pyx_t_26);
6807 PyTuple_SET_ITEM(__pyx_t_27, 2, __pyx_t_26);
6811 __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_27);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 244, __pyx_L1_error)
6812 __Pyx_GOTREF(__pyx_t_26);
6813 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6814 __pyx_t_27 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6815 __Pyx_GOTREF(__pyx_t_27);
6818 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) {
6819 __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_24);
6820 if (likely(__pyx_t_25)) {
6821 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_24);
6822 __Pyx_INCREF(__pyx_t_25);
6823 __Pyx_INCREF(
function);
6824 __Pyx_DECREF_SET(__pyx_t_24,
function);
6828 #if CYTHON_FAST_PYCALL
6829 if (PyFunction_Check(__pyx_t_24)) {
6830 PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_26, __pyx_t_27};
6831 __pyx_t_22 = __Pyx_PyFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6832 __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
6833 __Pyx_GOTREF(__pyx_t_22);
6834 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
6835 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6838 #if CYTHON_FAST_PYCCALL
6839 if (__Pyx_PyFastCFunction_Check(__pyx_t_24)) {
6840 PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_26, __pyx_t_27};
6841 __pyx_t_22 = __Pyx_PyCFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6842 __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
6843 __Pyx_GOTREF(__pyx_t_22);
6844 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
6845 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6849 __pyx_t_23 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6850 __Pyx_GOTREF(__pyx_t_23);
6852 __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_25); __pyx_t_25 = NULL;
6854 __Pyx_GIVEREF(__pyx_t_26);
6855 PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_28, __pyx_t_26);
6856 __Pyx_GIVEREF(__pyx_t_27);
6857 PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_28, __pyx_t_27);
6860 __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_23, NULL);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6861 __Pyx_GOTREF(__pyx_t_22);
6862 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6864 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6865 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6866 __Pyx_GOTREF(__pyx_t_24);
6867 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6868 __Pyx_GOTREF(__pyx_t_23);
6869 __pyx_t_27 = PyTuple_New(2);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6870 __Pyx_GOTREF(__pyx_t_27);
6871 __Pyx_GIVEREF(__pyx_t_24);
6872 PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_24);
6873 __Pyx_GIVEREF(__pyx_t_23);
6874 PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_23);
6877 __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_22, __pyx_t_27);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6878 __Pyx_GOTREF(__pyx_t_23);
6879 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6880 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6881 __pyx_t_27 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_23);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 244, __pyx_L1_error)
6882 __Pyx_GOTREF(__pyx_t_27);
6883 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6884 if (unlikely(__pyx_v_material_functions == Py_None)) {
6885 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6886 __PYX_ERR(0, 244, __pyx_L1_error)
6888 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6889 __Pyx_GOTREF(__pyx_t_22);
6890 __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6891 __Pyx_GOTREF(__pyx_t_24);
6892 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6893 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6894 __Pyx_GOTREF(__pyx_t_22);
6895 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 244, __pyx_L1_error)
6896 __Pyx_GOTREF(__pyx_t_26);
6897 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
6898 __Pyx_GOTREF(__pyx_t_25);
6899 __pyx_t_29 = PyTuple_New(3);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
6900 __Pyx_GOTREF(__pyx_t_29);
6901 __Pyx_GIVEREF(__pyx_t_22);
6902 PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_22);
6903 __Pyx_GIVEREF(__pyx_t_26);
6904 PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_26);
6905 __Pyx_GIVEREF(__pyx_t_25);
6906 PyTuple_SET_ITEM(__pyx_t_29, 2, __pyx_t_25);
6910 __pyx_t_25 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_29);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
6911 __Pyx_GOTREF(__pyx_t_25);
6912 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
6913 __pyx_t_29 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
6914 __Pyx_GOTREF(__pyx_t_29);
6917 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_24))) {
6918 __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_24);
6919 if (likely(__pyx_t_26)) {
6920 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_24);
6921 __Pyx_INCREF(__pyx_t_26);
6922 __Pyx_INCREF(
function);
6923 __Pyx_DECREF_SET(__pyx_t_24,
function);
6927 #if CYTHON_FAST_PYCALL
6928 if (PyFunction_Check(__pyx_t_24)) {
6929 PyObject *__pyx_temp[3] = {__pyx_t_26, __pyx_t_25, __pyx_t_29};
6930 __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6931 __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
6932 __Pyx_GOTREF(__pyx_t_23);
6933 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
6934 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
6937 #if CYTHON_FAST_PYCCALL
6938 if (__Pyx_PyFastCFunction_Check(__pyx_t_24)) {
6939 PyObject *__pyx_temp[3] = {__pyx_t_26, __pyx_t_25, __pyx_t_29};
6940 __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_24, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6941 __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
6942 __Pyx_GOTREF(__pyx_t_23);
6943 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
6944 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
6948 __pyx_t_22 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6949 __Pyx_GOTREF(__pyx_t_22);
6951 __Pyx_GIVEREF(__pyx_t_26); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_26); __pyx_t_26 = NULL;
6953 __Pyx_GIVEREF(__pyx_t_25);
6954 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_28, __pyx_t_25);
6955 __Pyx_GIVEREF(__pyx_t_29);
6956 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_28, __pyx_t_29);
6959 __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6960 __Pyx_GOTREF(__pyx_t_23);
6961 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6963 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6964 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6965 __Pyx_GOTREF(__pyx_t_24);
6966 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6967 __Pyx_GOTREF(__pyx_t_22);
6968 __pyx_t_29 = PyTuple_New(2);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
6969 __Pyx_GOTREF(__pyx_t_29);
6970 __Pyx_GIVEREF(__pyx_t_24);
6971 PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_24);
6972 __Pyx_GIVEREF(__pyx_t_22);
6973 PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_22);
6976 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_29);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6977 __Pyx_GOTREF(__pyx_t_22);
6978 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6979 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
6980 __pyx_t_29 = PyNumber_Multiply(__pyx_t_27, __pyx_t_22);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 244, __pyx_L1_error)
6981 __Pyx_GOTREF(__pyx_t_29);
6982 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
6983 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6984 __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_29);
if (unlikely((__pyx_t_30 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
6985 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
6986 __pyx_v_numer = __pyx_t_30;
6995 if (unlikely(__pyx_v_material_functions == Py_None)) {
6996 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6997 __PYX_ERR(0, 245, __pyx_L1_error)
6999 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7000 __Pyx_GOTREF(__pyx_t_22);
7001 __pyx_t_27 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7002 __Pyx_GOTREF(__pyx_t_27);
7003 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7004 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7005 __Pyx_GOTREF(__pyx_t_22);
7006 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7007 __Pyx_GOTREF(__pyx_t_23);
7008 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
7009 __Pyx_GOTREF(__pyx_t_24);
7010 __pyx_t_25 = PyTuple_New(3);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7011 __Pyx_GOTREF(__pyx_t_25);
7012 __Pyx_GIVEREF(__pyx_t_22);
7013 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_22);
7014 __Pyx_GIVEREF(__pyx_t_23);
7015 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_23);
7016 __Pyx_GIVEREF(__pyx_t_24);
7017 PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_24);
7021 __pyx_t_24 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_25);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
7022 __Pyx_GOTREF(__pyx_t_24);
7023 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7024 __pyx_t_25 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7025 __Pyx_GOTREF(__pyx_t_25);
7028 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_27))) {
7029 __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_27);
7030 if (likely(__pyx_t_23)) {
7031 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_27);
7032 __Pyx_INCREF(__pyx_t_23);
7033 __Pyx_INCREF(
function);
7034 __Pyx_DECREF_SET(__pyx_t_27,
function);
7038 #if CYTHON_FAST_PYCALL
7039 if (PyFunction_Check(__pyx_t_27)) {
7040 PyObject *__pyx_temp[3] = {__pyx_t_23, __pyx_t_24, __pyx_t_25};
7041 __pyx_t_29 = __Pyx_PyFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7042 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
7043 __Pyx_GOTREF(__pyx_t_29);
7044 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
7045 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7048 #if CYTHON_FAST_PYCCALL
7049 if (__Pyx_PyFastCFunction_Check(__pyx_t_27)) {
7050 PyObject *__pyx_temp[3] = {__pyx_t_23, __pyx_t_24, __pyx_t_25};
7051 __pyx_t_29 = __Pyx_PyCFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7052 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
7053 __Pyx_GOTREF(__pyx_t_29);
7054 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
7055 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7059 __pyx_t_22 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7060 __Pyx_GOTREF(__pyx_t_22);
7062 __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23); __pyx_t_23 = NULL;
7064 __Pyx_GIVEREF(__pyx_t_24);
7065 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_28, __pyx_t_24);
7066 __Pyx_GIVEREF(__pyx_t_25);
7067 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_28, __pyx_t_25);
7070 __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_27, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7071 __Pyx_GOTREF(__pyx_t_29);
7072 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7074 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
7075 __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7076 __Pyx_GOTREF(__pyx_t_27);
7077 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7078 __Pyx_GOTREF(__pyx_t_22);
7079 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7080 __Pyx_GOTREF(__pyx_t_25);
7081 __Pyx_GIVEREF(__pyx_t_27);
7082 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_27);
7083 __Pyx_GIVEREF(__pyx_t_22);
7084 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_22);
7087 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_29, __pyx_t_25);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_22);
7089 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7090 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7091 if (unlikely(__pyx_v_material_functions == Py_None)) {
7092 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7093 __PYX_ERR(0, 245, __pyx_L1_error)
7095 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7096 __Pyx_GOTREF(__pyx_t_29);
7097 __pyx_t_27 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_29);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7098 __Pyx_GOTREF(__pyx_t_27);
7099 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7100 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7101 __Pyx_GOTREF(__pyx_t_29);
7102 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
7103 __Pyx_GOTREF(__pyx_t_24);
7104 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7105 __Pyx_GOTREF(__pyx_t_23);
7106 __pyx_t_26 = PyTuple_New(3);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7107 __Pyx_GOTREF(__pyx_t_26);
7108 __Pyx_GIVEREF(__pyx_t_29);
7109 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_29);
7110 __Pyx_GIVEREF(__pyx_t_24);
7111 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_24);
7112 __Pyx_GIVEREF(__pyx_t_23);
7113 PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_t_23);
7117 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_26);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7118 __Pyx_GOTREF(__pyx_t_23);
7119 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7120 __pyx_t_26 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7121 __Pyx_GOTREF(__pyx_t_26);
7124 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_27))) {
7125 __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_27);
7126 if (likely(__pyx_t_24)) {
7127 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_27);
7128 __Pyx_INCREF(__pyx_t_24);
7129 __Pyx_INCREF(
function);
7130 __Pyx_DECREF_SET(__pyx_t_27,
function);
7134 #if CYTHON_FAST_PYCALL
7135 if (PyFunction_Check(__pyx_t_27)) {
7136 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_26};
7137 __pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7138 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
7139 __Pyx_GOTREF(__pyx_t_25);
7140 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7141 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7144 #if CYTHON_FAST_PYCCALL
7145 if (__Pyx_PyFastCFunction_Check(__pyx_t_27)) {
7146 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_26};
7147 __pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_27, __pyx_temp+1-__pyx_t_28, 2+__pyx_t_28);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7148 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
7149 __Pyx_GOTREF(__pyx_t_25);
7150 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7151 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7155 __pyx_t_29 = PyTuple_New(2+__pyx_t_28);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7156 __Pyx_GOTREF(__pyx_t_29);
7158 __Pyx_GIVEREF(__pyx_t_24); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_24); __pyx_t_24 = NULL;
7160 __Pyx_GIVEREF(__pyx_t_23);
7161 PyTuple_SET_ITEM(__pyx_t_29, 0+__pyx_t_28, __pyx_t_23);
7162 __Pyx_GIVEREF(__pyx_t_26);
7163 PyTuple_SET_ITEM(__pyx_t_29, 1+__pyx_t_28, __pyx_t_26);
7166 __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_27, __pyx_t_29, NULL);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7167 __Pyx_GOTREF(__pyx_t_25);
7168 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7170 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
7171 __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 245, __pyx_L1_error)
7172 __Pyx_GOTREF(__pyx_t_27);
7173 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7174 __Pyx_GOTREF(__pyx_t_29);
7175 __pyx_t_26 = PyTuple_New(2);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7176 __Pyx_GOTREF(__pyx_t_26);
7177 __Pyx_GIVEREF(__pyx_t_27);
7178 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_27);
7179 __Pyx_GIVEREF(__pyx_t_29);
7180 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_29);
7183 __pyx_t_29 = __Pyx_PyObject_GetItem(__pyx_t_25, __pyx_t_26);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7184 __Pyx_GOTREF(__pyx_t_29);
7185 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7186 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7187 __pyx_t_26 = PyNumber_Add(__pyx_t_22, __pyx_t_29);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 245, __pyx_L1_error)
7188 __Pyx_GOTREF(__pyx_t_26);
7189 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7190 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7191 __pyx_t_29 = __Pyx_PyFloat_AddObjC(__pyx_t_26, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 245, __pyx_L1_error)
7192 __Pyx_GOTREF(__pyx_t_29);
7193 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
7194 __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_29);
if (unlikely((__pyx_t_30 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
7195 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
7196 __pyx_v_denom = __pyx_t_30;
7205 if (unlikely(__pyx_v_denom == 0)) {
7206 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
7207 __PYX_ERR(0, 246, __pyx_L1_error)
7209 __pyx_t_31 = __pyx_v_eN;
7210 __pyx_t_32 = __pyx_v_ebN_local;
7211 __pyx_t_33 = __pyx_v_k;
7212 __pyx_t_34 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
7214 if (__pyx_t_31 < 0) {
7215 __pyx_t_31 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
7216 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 0;
7217 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_28 = 0;
7218 if (__pyx_t_32 < 0) {
7219 __pyx_t_32 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
7220 if (unlikely(__pyx_t_32 < 0)) __pyx_t_28 = 1;
7221 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_28 = 1;
7222 if (__pyx_t_33 < 0) {
7223 __pyx_t_33 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
7224 if (unlikely(__pyx_t_33 < 0)) __pyx_t_28 = 2;
7225 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_28 = 2;
7226 if (__pyx_t_34 < 0) {
7227 __pyx_t_34 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
7228 if (unlikely(__pyx_t_34 < 0)) __pyx_t_28 = 3;
7229 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_28 = 3;
7230 if (unlikely(__pyx_t_28 != -1)) {
7231 __Pyx_RaiseBufferIndexError(__pyx_t_28);
7232 __PYX_ERR(0, 246, __pyx_L1_error)
7234 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_34, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
7250 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7253 __Pyx_XDECREF(__pyx_t_22);
7254 __Pyx_XDECREF(__pyx_t_23);
7255 __Pyx_XDECREF(__pyx_t_24);
7256 __Pyx_XDECREF(__pyx_t_25);
7257 __Pyx_XDECREF(__pyx_t_26);
7258 __Pyx_XDECREF(__pyx_t_27);
7259 __Pyx_XDECREF(__pyx_t_29);
7260 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7261 __Pyx_PyThreadState_declare
7262 __Pyx_PyThreadState_assign
7263 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7264 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7265 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7266 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7267 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7268 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7269 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7273 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7274 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7275 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7276 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7278 __Pyx_XGIVEREF(__pyx_r);
7279 __Pyx_RefNannyFinishContext();
7292 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7293 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7294 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
7295 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7297 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7298 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7299 PyArrayObject *__pyx_v_x = 0;
7300 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7301 PyObject *__pyx_v_material_functions = 0;
7302 PyObject *__pyx_r = 0;
7303 __Pyx_RefNannyDeclarations
7304 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
7306 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7307 PyObject* values[6] = {0,0,0,0,0,0};
7308 if (unlikely(__pyx_kwds)) {
7310 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7312 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7314 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7316 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7318 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7320 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7322 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7325 default:
goto __pyx_L5_argtuple_error;
7327 kw_args = PyDict_Size(__pyx_kwds);
7330 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7331 else goto __pyx_L5_argtuple_error;
7334 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7336 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 248, __pyx_L3_error)
7340 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7342 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 248, __pyx_L3_error)
7346 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7348 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 248, __pyx_L3_error)
7352 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7354 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 248, __pyx_L3_error)
7358 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7360 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 248, __pyx_L3_error)
7363 if (unlikely(kw_args > 0)) {
7364 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
7366 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7367 goto __pyx_L5_argtuple_error;
7369 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7370 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7371 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7372 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7373 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7374 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7376 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
7377 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
7378 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
7379 __pyx_v_x = ((PyArrayObject *)values[3]);
7380 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
7381 __pyx_v_material_functions = ((PyObject*)values[5]);
7383 goto __pyx_L4_argument_unpacking_done;
7384 __pyx_L5_argtuple_error:;
7385 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
7387 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7388 __Pyx_RefNannyFinishContext();
7390 __pyx_L4_argument_unpacking_done:;
7391 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 249, __pyx_L1_error)
7392 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
7393 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
7394 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
7395 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
7396 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7403 __Pyx_RefNannyFinishContext();
7407 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7409 int __pyx_v_material_left;
7410 int __pyx_v_material_right;
7412 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7413 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7414 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7415 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7416 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7417 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7418 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7419 __Pyx_Buffer __pyx_pybuffer_x;
7420 PyObject *__pyx_r = NULL;
7421 __Pyx_RefNannyDeclarations
7425 Py_ssize_t __pyx_t_4;
7426 Py_ssize_t __pyx_t_5;
7428 Py_ssize_t __pyx_t_7;
7429 Py_ssize_t __pyx_t_8;
7431 npy_intp __pyx_t_10;
7432 npy_intp __pyx_t_11;
7433 PyObject *__pyx_t_12 = NULL;
7434 PyObject *__pyx_t_13 = NULL;
7435 PyObject *__pyx_t_14 = NULL;
7436 PyObject *__pyx_t_15 = NULL;
7437 PyObject *__pyx_t_16 = NULL;
7438 PyObject *__pyx_t_17 = NULL;
7439 PyObject *__pyx_t_18 = NULL;
7440 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_19;
7441 Py_ssize_t __pyx_t_20;
7442 Py_ssize_t __pyx_t_21;
7443 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
7444 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7445 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7446 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7447 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7448 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7449 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7450 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7451 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7452 __pyx_pybuffer_x.pybuffer.buf = NULL;
7453 __pyx_pybuffer_x.refcount = 0;
7454 __pyx_pybuffernd_x.data = NULL;
7455 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7456 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7457 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7458 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7459 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7461 __Pyx_BufFmt_StackElem __pyx_stack[1];
7462 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7464 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7466 __Pyx_BufFmt_StackElem __pyx_stack[1];
7467 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7469 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7471 __Pyx_BufFmt_StackElem __pyx_stack[1];
7472 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7474 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
7476 __Pyx_BufFmt_StackElem __pyx_stack[1];
7477 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7479 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
7488 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7489 __pyx_t_2 = __pyx_t_1;
7490 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7491 __pyx_v_ebN = __pyx_t_3;
7500 __pyx_t_4 = __pyx_v_ebN;
7503 if (__pyx_t_4 < 0) {
7504 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7505 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7506 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7507 if (__pyx_t_5 < 0) {
7508 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7509 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7510 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7511 if (unlikely(__pyx_t_6 != -1)) {
7512 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7513 __PYX_ERR(0, 264, __pyx_L1_error)
7515 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7524 __pyx_t_7 = __pyx_v_ebN;
7527 if (__pyx_t_7 < 0) {
7528 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7529 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
7530 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7531 if (__pyx_t_8 < 0) {
7532 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7533 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
7534 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7535 if (unlikely(__pyx_t_6 != -1)) {
7536 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7537 __PYX_ERR(0, 265, __pyx_L1_error)
7539 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7548 __pyx_t_9 = (__pyx_v_x->dimensions[1]);
7549 __pyx_t_10 = __pyx_t_9;
7550 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
7551 __pyx_v_k = __pyx_t_11;
7560 if (unlikely(__pyx_v_material_functions == Py_None)) {
7561 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7562 __PYX_ERR(0, 267, __pyx_L1_error)
7564 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7565 __Pyx_GOTREF(__pyx_t_13);
7566 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7567 __Pyx_GOTREF(__pyx_t_14);
7568 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7569 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7570 __Pyx_GOTREF(__pyx_t_13);
7571 __pyx_t_15 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7572 __Pyx_GOTREF(__pyx_t_15);
7573 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 267, __pyx_L1_error)
7574 __Pyx_GOTREF(__pyx_t_16);
7575 __Pyx_GIVEREF(__pyx_t_13);
7576 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_13);
7577 __Pyx_GIVEREF(__pyx_t_15);
7578 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
7581 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7582 __Pyx_GOTREF(__pyx_t_15);
7583 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7584 __pyx_t_16 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 267, __pyx_L1_error)
7585 __Pyx_GOTREF(__pyx_t_16);
7588 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
7589 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
7590 if (likely(__pyx_t_13)) {
7591 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
7592 __Pyx_INCREF(__pyx_t_13);
7593 __Pyx_INCREF(
function);
7594 __Pyx_DECREF_SET(__pyx_t_14,
function);
7598 #if CYTHON_FAST_PYCALL
7599 if (PyFunction_Check(__pyx_t_14)) {
7600 PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, __pyx_t_16};
7601 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7602 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7603 __Pyx_GOTREF(__pyx_t_12);
7604 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7605 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7608 #if CYTHON_FAST_PYCCALL
7609 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
7610 PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, __pyx_t_16};
7611 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7612 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7613 __Pyx_GOTREF(__pyx_t_12);
7614 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7615 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7619 __pyx_t_17 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 267, __pyx_L1_error)
7620 __Pyx_GOTREF(__pyx_t_17);
7622 __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13); __pyx_t_13 = NULL;
7624 __Pyx_GIVEREF(__pyx_t_15);
7625 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_6, __pyx_t_15);
7626 __Pyx_GIVEREF(__pyx_t_16);
7627 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_6, __pyx_t_16);
7630 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7631 __Pyx_GOTREF(__pyx_t_12);
7632 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7634 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7643 if (unlikely(__pyx_v_material_functions == Py_None)) {
7644 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7645 __PYX_ERR(0, 268, __pyx_L1_error)
7647 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 268, __pyx_L1_error)
7648 __Pyx_GOTREF(__pyx_t_17);
7649 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 268, __pyx_L1_error)
7650 __Pyx_GOTREF(__pyx_t_16);
7651 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7652 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 268, __pyx_L1_error)
7653 __Pyx_GOTREF(__pyx_t_17);
7654 __pyx_t_15 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7655 __Pyx_GOTREF(__pyx_t_15);
7656 __pyx_t_13 = PyTuple_New(2);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7657 __Pyx_GOTREF(__pyx_t_13);
7658 __Pyx_GIVEREF(__pyx_t_17);
7659 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_17);
7660 __Pyx_GIVEREF(__pyx_t_15);
7661 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15);
7664 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7665 __Pyx_GOTREF(__pyx_t_15);
7666 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7667 __pyx_t_13 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7668 __Pyx_GOTREF(__pyx_t_13);
7671 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
7672 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
7673 if (likely(__pyx_t_17)) {
7674 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_16);
7675 __Pyx_INCREF(__pyx_t_17);
7676 __Pyx_INCREF(
function);
7677 __Pyx_DECREF_SET(__pyx_t_16,
function);
7681 #if CYTHON_FAST_PYCALL
7682 if (PyFunction_Check(__pyx_t_16)) {
7683 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_15, __pyx_t_13};
7684 __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7685 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7686 __Pyx_GOTREF(__pyx_t_14);
7687 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7688 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7691 #if CYTHON_FAST_PYCCALL
7692 if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) {
7693 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_15, __pyx_t_13};
7694 __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7695 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
7696 __Pyx_GOTREF(__pyx_t_14);
7697 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7698 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7702 __pyx_t_18 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 268, __pyx_L1_error)
7703 __Pyx_GOTREF(__pyx_t_18);
7705 __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); __pyx_t_17 = NULL;
7707 __Pyx_GIVEREF(__pyx_t_15);
7708 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_6, __pyx_t_15);
7709 __Pyx_GIVEREF(__pyx_t_13);
7710 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_6, __pyx_t_13);
7713 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7714 __Pyx_GOTREF(__pyx_t_14);
7715 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7717 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7726 __pyx_t_16 = PyNumber_Add(__pyx_t_12, __pyx_t_14);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 267, __pyx_L1_error)
7727 __Pyx_GOTREF(__pyx_t_16);
7728 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7729 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7730 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_16);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7731 __Pyx_GOTREF(__pyx_t_14);
7732 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7733 __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_19 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
7734 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7735 __pyx_t_20 = __pyx_v_ebN;
7736 __pyx_t_21 = __pyx_v_k;
7738 if (__pyx_t_20 < 0) {
7739 __pyx_t_20 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7740 if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
7741 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
7742 if (__pyx_t_21 < 0) {
7743 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7744 if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 1;
7745 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
7746 if (unlikely(__pyx_t_6 != -1)) {
7747 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7748 __PYX_ERR(0, 267, __pyx_L1_error)
7750 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_19;
7763 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7766 __Pyx_XDECREF(__pyx_t_12);
7767 __Pyx_XDECREF(__pyx_t_13);
7768 __Pyx_XDECREF(__pyx_t_14);
7769 __Pyx_XDECREF(__pyx_t_15);
7770 __Pyx_XDECREF(__pyx_t_16);
7771 __Pyx_XDECREF(__pyx_t_17);
7772 __Pyx_XDECREF(__pyx_t_18);
7773 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7774 __Pyx_PyThreadState_declare
7775 __Pyx_PyThreadState_assign
7776 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7777 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7778 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7779 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7780 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7781 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7782 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7786 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7787 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7788 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7789 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7791 __Pyx_XGIVEREF(__pyx_r);
7792 __Pyx_RefNannyFinishContext();
7805 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7806 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7807 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
7808 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7811 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7812 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7813 PyArrayObject *__pyx_v_x = 0;
7814 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7815 PyObject *__pyx_v_material_functions = 0;
7816 PyObject *__pyx_r = 0;
7817 __Pyx_RefNannyDeclarations
7818 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
7820 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7821 PyObject* values[7] = {0,0,0,0,0,0,0};
7822 if (unlikely(__pyx_kwds)) {
7824 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7826 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7828 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7830 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7832 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7834 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7836 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7838 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7841 default:
goto __pyx_L5_argtuple_error;
7843 kw_args = PyDict_Size(__pyx_kwds);
7846 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
7847 else goto __pyx_L5_argtuple_error;
7850 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7852 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 271, __pyx_L3_error)
7856 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7858 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 271, __pyx_L3_error)
7862 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7864 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 271, __pyx_L3_error)
7868 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7870 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 271, __pyx_L3_error)
7874 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7876 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 271, __pyx_L3_error)
7880 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7882 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 271, __pyx_L3_error)
7885 if (unlikely(kw_args > 0)) {
7886 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
7888 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
7889 goto __pyx_L5_argtuple_error;
7891 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7892 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7893 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7894 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7895 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7896 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7897 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7899 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
7900 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
7901 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
7902 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
7903 __pyx_v_x = ((PyArrayObject *)values[4]);
7904 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
7905 __pyx_v_material_functions = ((PyObject*)values[6]);
7907 goto __pyx_L4_argument_unpacking_done;
7908 __pyx_L5_argtuple_error:;
7909 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
7911 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7912 __Pyx_RefNannyFinishContext();
7914 __pyx_L4_argument_unpacking_done:;
7915 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 273, __pyx_L1_error)
7916 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
7917 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
7918 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
7919 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 277, __pyx_L1_error)
7920 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7927 __Pyx_RefNannyFinishContext();
7931 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7934 int __pyx_v_material_left;
7935 int __pyx_v_material_right;
7938 double __pyx_v_numer;
7939 double __pyx_v_denom;
7940 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7941 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7942 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7943 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7944 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7945 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7946 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7947 __Pyx_Buffer __pyx_pybuffer_x;
7948 PyObject *__pyx_r = NULL;
7949 __Pyx_RefNannyDeclarations
7953 Py_ssize_t __pyx_t_4;
7954 Py_ssize_t __pyx_t_5;
7956 Py_ssize_t __pyx_t_7;
7957 Py_ssize_t __pyx_t_8;
7959 npy_intp __pyx_t_10;
7966 PyObject *__pyx_t_17 = NULL;
7967 PyObject *__pyx_t_18 = NULL;
7968 PyObject *__pyx_t_19 = NULL;
7969 PyObject *__pyx_t_20 = NULL;
7970 PyObject *__pyx_t_21 = NULL;
7972 PyObject *__pyx_t_23 = NULL;
7973 PyObject *__pyx_t_24 = NULL;
7975 Py_ssize_t __pyx_t_26;
7976 Py_ssize_t __pyx_t_27;
7977 Py_ssize_t __pyx_t_28;
7978 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
7979 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7980 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7981 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7982 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7983 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7984 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7985 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7986 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7987 __pyx_pybuffer_x.pybuffer.buf = NULL;
7988 __pyx_pybuffer_x.refcount = 0;
7989 __pyx_pybuffernd_x.data = NULL;
7990 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7991 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7992 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7993 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7994 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7996 __Pyx_BufFmt_StackElem __pyx_stack[1];
7997 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
7999 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
8001 __Pyx_BufFmt_StackElem __pyx_stack[1];
8002 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8004 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
8006 __Pyx_BufFmt_StackElem __pyx_stack[1];
8007 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8009 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
8011 __Pyx_BufFmt_StackElem __pyx_stack[1];
8012 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8014 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
8023 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
8024 __pyx_t_2 = __pyx_t_1;
8025 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8026 __pyx_v_ebN = __pyx_t_3;
8035 __pyx_t_4 = __pyx_v_ebN;
8038 if (__pyx_t_4 < 0) {
8039 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8040 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
8041 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8042 if (__pyx_t_5 < 0) {
8043 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8044 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
8045 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8046 if (unlikely(__pyx_t_6 != -1)) {
8047 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8048 __PYX_ERR(0, 289, __pyx_L1_error)
8050 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8059 __pyx_t_7 = __pyx_v_ebN;
8062 if (__pyx_t_7 < 0) {
8063 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8064 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
8065 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8066 if (__pyx_t_8 < 0) {
8067 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8068 if (unlikely(__pyx_t_8 < 0)) __pyx_t_6 = 1;
8069 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8070 if (unlikely(__pyx_t_6 != -1)) {
8071 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8072 __PYX_ERR(0, 290, __pyx_L1_error)
8074 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8083 __pyx_t_9 = (__pyx_v_x->dimensions[1]);
8084 __pyx_t_10 = __pyx_t_9;
8085 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_10; __pyx_t_6+=1) {
8086 __pyx_v_k = __pyx_t_6;
8095 __pyx_t_11 = __pyx_v_nd;
8096 __pyx_t_12 = __pyx_t_11;
8097 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
8098 __pyx_v_I = __pyx_t_13;
8107 __pyx_t_14 = __pyx_v_nd;
8108 __pyx_t_15 = __pyx_t_14;
8109 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
8110 __pyx_v_J = __pyx_t_16;
8119 if (unlikely(__pyx_v_material_functions == Py_None)) {
8120 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8121 __PYX_ERR(0, 294, __pyx_L1_error)
8123 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8124 __Pyx_GOTREF(__pyx_t_18);
8125 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8126 __Pyx_GOTREF(__pyx_t_19);
8127 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8128 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8129 __Pyx_GOTREF(__pyx_t_18);
8130 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8131 __Pyx_GOTREF(__pyx_t_20);
8132 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8133 __Pyx_GOTREF(__pyx_t_21);
8134 __Pyx_GIVEREF(__pyx_t_18);
8135 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
8136 __Pyx_GIVEREF(__pyx_t_20);
8137 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20);
8140 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8141 __Pyx_GOTREF(__pyx_t_20);
8142 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8143 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8144 __Pyx_GOTREF(__pyx_t_21);
8147 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8148 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
8149 if (likely(__pyx_t_18)) {
8150 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8151 __Pyx_INCREF(__pyx_t_18);
8152 __Pyx_INCREF(
function);
8153 __Pyx_DECREF_SET(__pyx_t_19,
function);
8157 #if CYTHON_FAST_PYCALL
8158 if (PyFunction_Check(__pyx_t_19)) {
8159 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_20, __pyx_t_21};
8160 __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8161 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8162 __Pyx_GOTREF(__pyx_t_17);
8163 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8164 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8167 #if CYTHON_FAST_PYCCALL
8168 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8169 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_20, __pyx_t_21};
8170 __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8171 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8172 __Pyx_GOTREF(__pyx_t_17);
8173 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8174 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8178 __pyx_t_23 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8179 __Pyx_GOTREF(__pyx_t_23);
8181 __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_18); __pyx_t_18 = NULL;
8183 __Pyx_GIVEREF(__pyx_t_20);
8184 PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_22, __pyx_t_20);
8185 __Pyx_GIVEREF(__pyx_t_21);
8186 PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_22, __pyx_t_21);
8189 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_23, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8190 __Pyx_GOTREF(__pyx_t_17);
8191 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8193 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8194 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8195 __Pyx_GOTREF(__pyx_t_19);
8196 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8197 __Pyx_GOTREF(__pyx_t_23);
8198 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8199 __Pyx_GOTREF(__pyx_t_21);
8200 __Pyx_GIVEREF(__pyx_t_19);
8201 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19);
8202 __Pyx_GIVEREF(__pyx_t_23);
8203 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23);
8206 __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_21);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8207 __Pyx_GOTREF(__pyx_t_23);
8208 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8209 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8210 __pyx_t_21 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_23);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8211 __Pyx_GOTREF(__pyx_t_21);
8212 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8213 if (unlikely(__pyx_v_material_functions == Py_None)) {
8214 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8215 __PYX_ERR(0, 294, __pyx_L1_error)
8217 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8218 __Pyx_GOTREF(__pyx_t_17);
8219 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8220 __Pyx_GOTREF(__pyx_t_19);
8221 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8222 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8223 __Pyx_GOTREF(__pyx_t_17);
8224 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8225 __Pyx_GOTREF(__pyx_t_20);
8226 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8227 __Pyx_GOTREF(__pyx_t_18);
8228 __Pyx_GIVEREF(__pyx_t_17);
8229 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17);
8230 __Pyx_GIVEREF(__pyx_t_20);
8231 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
8234 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
8235 __Pyx_GOTREF(__pyx_t_20);
8236 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8237 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8238 __Pyx_GOTREF(__pyx_t_18);
8241 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8242 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_19);
8243 if (likely(__pyx_t_17)) {
8244 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8245 __Pyx_INCREF(__pyx_t_17);
8246 __Pyx_INCREF(
function);
8247 __Pyx_DECREF_SET(__pyx_t_19,
function);
8251 #if CYTHON_FAST_PYCALL
8252 if (PyFunction_Check(__pyx_t_19)) {
8253 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_20, __pyx_t_18};
8254 __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8255 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
8256 __Pyx_GOTREF(__pyx_t_23);
8257 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8258 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8261 #if CYTHON_FAST_PYCCALL
8262 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8263 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_20, __pyx_t_18};
8264 __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8265 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
8266 __Pyx_GOTREF(__pyx_t_23);
8267 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8268 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8272 __pyx_t_24 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 294, __pyx_L1_error)
8273 __Pyx_GOTREF(__pyx_t_24);
8275 __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_17); __pyx_t_17 = NULL;
8277 __Pyx_GIVEREF(__pyx_t_20);
8278 PyTuple_SET_ITEM(__pyx_t_24, 0+__pyx_t_22, __pyx_t_20);
8279 __Pyx_GIVEREF(__pyx_t_18);
8280 PyTuple_SET_ITEM(__pyx_t_24, 1+__pyx_t_22, __pyx_t_18);
8283 __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_24, NULL);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 294, __pyx_L1_error)
8284 __Pyx_GOTREF(__pyx_t_23);
8285 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8287 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8288 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8289 __Pyx_GOTREF(__pyx_t_19);
8290 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 294, __pyx_L1_error)
8291 __Pyx_GOTREF(__pyx_t_24);
8292 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8293 __Pyx_GOTREF(__pyx_t_18);
8294 __Pyx_GIVEREF(__pyx_t_19);
8295 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19);
8296 __Pyx_GIVEREF(__pyx_t_24);
8297 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_24);
8300 __pyx_t_24 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_18);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 294, __pyx_L1_error)
8301 __Pyx_GOTREF(__pyx_t_24);
8302 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8303 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8304 __pyx_t_18 = PyNumber_Multiply(__pyx_t_21, __pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8305 __Pyx_GOTREF(__pyx_t_18);
8306 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8307 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8308 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
8309 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8310 __pyx_v_numer = __pyx_t_25;
8319 if (unlikely(__pyx_v_material_functions == Py_None)) {
8320 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8321 __PYX_ERR(0, 295, __pyx_L1_error)
8323 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8324 __Pyx_GOTREF(__pyx_t_24);
8325 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8326 __Pyx_GOTREF(__pyx_t_21);
8327 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8328 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8329 __Pyx_GOTREF(__pyx_t_24);
8330 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8331 __Pyx_GOTREF(__pyx_t_23);
8332 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8333 __Pyx_GOTREF(__pyx_t_19);
8334 __Pyx_GIVEREF(__pyx_t_24);
8335 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_24);
8336 __Pyx_GIVEREF(__pyx_t_23);
8337 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_23);
8340 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8341 __Pyx_GOTREF(__pyx_t_23);
8342 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8343 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8344 __Pyx_GOTREF(__pyx_t_19);
8347 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
8348 __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_21);
8349 if (likely(__pyx_t_24)) {
8350 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_21);
8351 __Pyx_INCREF(__pyx_t_24);
8352 __Pyx_INCREF(
function);
8353 __Pyx_DECREF_SET(__pyx_t_21,
function);
8357 #if CYTHON_FAST_PYCALL
8358 if (PyFunction_Check(__pyx_t_21)) {
8359 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_19};
8360 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8361 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
8362 __Pyx_GOTREF(__pyx_t_18);
8363 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8364 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8367 #if CYTHON_FAST_PYCCALL
8368 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
8369 PyObject *__pyx_temp[3] = {__pyx_t_24, __pyx_t_23, __pyx_t_19};
8370 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8371 __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
8372 __Pyx_GOTREF(__pyx_t_18);
8373 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8374 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8378 __pyx_t_20 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8379 __Pyx_GOTREF(__pyx_t_20);
8381 __Pyx_GIVEREF(__pyx_t_24); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_24); __pyx_t_24 = NULL;
8383 __Pyx_GIVEREF(__pyx_t_23);
8384 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_22, __pyx_t_23);
8385 __Pyx_GIVEREF(__pyx_t_19);
8386 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_22, __pyx_t_19);
8389 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8390 __Pyx_GOTREF(__pyx_t_18);
8391 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8393 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8394 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8395 __Pyx_GOTREF(__pyx_t_21);
8396 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8397 __Pyx_GOTREF(__pyx_t_20);
8398 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8399 __Pyx_GOTREF(__pyx_t_19);
8400 __Pyx_GIVEREF(__pyx_t_21);
8401 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_21);
8402 __Pyx_GIVEREF(__pyx_t_20);
8403 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_20);
8406 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8407 __Pyx_GOTREF(__pyx_t_20);
8408 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8409 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8410 if (unlikely(__pyx_v_material_functions == Py_None)) {
8411 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8412 __PYX_ERR(0, 295, __pyx_L1_error)
8414 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8415 __Pyx_GOTREF(__pyx_t_18);
8416 __pyx_t_21 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8417 __Pyx_GOTREF(__pyx_t_21);
8418 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8419 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8420 __Pyx_GOTREF(__pyx_t_18);
8421 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8422 __Pyx_GOTREF(__pyx_t_23);
8423 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8424 __Pyx_GOTREF(__pyx_t_24);
8425 __Pyx_GIVEREF(__pyx_t_18);
8426 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_18);
8427 __Pyx_GIVEREF(__pyx_t_23);
8428 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23);
8431 __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 295, __pyx_L1_error)
8432 __Pyx_GOTREF(__pyx_t_23);
8433 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8434 __pyx_t_24 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8435 __Pyx_GOTREF(__pyx_t_24);
8438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
8439 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_21);
8440 if (likely(__pyx_t_18)) {
8441 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_21);
8442 __Pyx_INCREF(__pyx_t_18);
8443 __Pyx_INCREF(
function);
8444 __Pyx_DECREF_SET(__pyx_t_21,
function);
8448 #if CYTHON_FAST_PYCALL
8449 if (PyFunction_Check(__pyx_t_21)) {
8450 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_23, __pyx_t_24};
8451 __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8452 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8453 __Pyx_GOTREF(__pyx_t_19);
8454 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8455 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8458 #if CYTHON_FAST_PYCCALL
8459 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
8460 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_23, __pyx_t_24};
8461 __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8462 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
8463 __Pyx_GOTREF(__pyx_t_19);
8464 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
8465 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8469 __pyx_t_17 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8470 __Pyx_GOTREF(__pyx_t_17);
8472 __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __pyx_t_18 = NULL;
8474 __Pyx_GIVEREF(__pyx_t_23);
8475 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_22, __pyx_t_23);
8476 __Pyx_GIVEREF(__pyx_t_24);
8477 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_22, __pyx_t_24);
8480 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8481 __Pyx_GOTREF(__pyx_t_19);
8482 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8484 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8485 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8486 __Pyx_GOTREF(__pyx_t_21);
8487 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8488 __Pyx_GOTREF(__pyx_t_17);
8489 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8490 __Pyx_GOTREF(__pyx_t_24);
8491 __Pyx_GIVEREF(__pyx_t_21);
8492 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_21);
8493 __Pyx_GIVEREF(__pyx_t_17);
8494 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_17);
8497 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_24);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8498 __Pyx_GOTREF(__pyx_t_17);
8499 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8500 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8501 __pyx_t_24 = PyNumber_Add(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 295, __pyx_L1_error)
8502 __Pyx_GOTREF(__pyx_t_24);
8503 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8504 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8505 __pyx_t_17 = __Pyx_PyFloat_AddObjC(__pyx_t_24, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8506 __Pyx_GOTREF(__pyx_t_17);
8507 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
8508 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_17);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
8509 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8510 __pyx_v_denom = __pyx_t_25;
8519 if (unlikely(__pyx_v_denom == 0)) {
8520 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8521 __PYX_ERR(0, 296, __pyx_L1_error)
8523 __pyx_t_26 = __pyx_v_ebN;
8524 __pyx_t_27 = __pyx_v_k;
8525 __pyx_t_28 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8527 if (__pyx_t_26 < 0) {
8528 __pyx_t_26 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
8529 if (unlikely(__pyx_t_26 < 0)) __pyx_t_22 = 0;
8530 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
8531 if (__pyx_t_27 < 0) {
8532 __pyx_t_27 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
8533 if (unlikely(__pyx_t_27 < 0)) __pyx_t_22 = 1;
8534 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
8535 if (__pyx_t_28 < 0) {
8536 __pyx_t_28 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
8537 if (unlikely(__pyx_t_28 < 0)) __pyx_t_22 = 2;
8538 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
8539 if (unlikely(__pyx_t_22 != -1)) {
8540 __Pyx_RaiseBufferIndexError(__pyx_t_22);
8541 __PYX_ERR(0, 296, __pyx_L1_error)
8543 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
8558 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8561 __Pyx_XDECREF(__pyx_t_17);
8562 __Pyx_XDECREF(__pyx_t_18);
8563 __Pyx_XDECREF(__pyx_t_19);
8564 __Pyx_XDECREF(__pyx_t_20);
8565 __Pyx_XDECREF(__pyx_t_21);
8566 __Pyx_XDECREF(__pyx_t_23);
8567 __Pyx_XDECREF(__pyx_t_24);
8568 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8569 __Pyx_PyThreadState_declare
8570 __Pyx_PyThreadState_assign
8571 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8572 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8573 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8574 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8575 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8576 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8577 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8581 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8582 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8583 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8584 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8586 __Pyx_XGIVEREF(__pyx_r);
8587 __Pyx_RefNannyFinishContext();
8600 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8601 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8602 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
8603 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8605 PyArrayObject *__pyx_v_gravity = 0;
8606 PyArrayObject *__pyx_v_rowptr = 0;
8607 PyArrayObject *__pyx_v_colind = 0;
8608 PyArrayObject *__pyx_v_KWs = 0;
8610 int __pyx_v_nElements_global;
8611 int __pyx_v_nElementBoundaries_element;
8612 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8613 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8614 PyArrayObject *__pyx_v_q_flin = 0;
8615 PyArrayObject *__pyx_v_q_alin = 0;
8616 PyObject *__pyx_r = 0;
8617 __Pyx_RefNannyDeclarations
8618 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
8620 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
8621 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
8622 if (unlikely(__pyx_kwds)) {
8624 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8626 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8628 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8630 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8632 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8634 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8636 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8638 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8640 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8642 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8644 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8646 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8648 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8651 default:
goto __pyx_L5_argtuple_error;
8653 kw_args = PyDict_Size(__pyx_kwds);
8656 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8657 else goto __pyx_L5_argtuple_error;
8660 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8662 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); __PYX_ERR(0, 301, __pyx_L3_error)
8666 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8668 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); __PYX_ERR(0, 301, __pyx_L3_error)
8672 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8674 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); __PYX_ERR(0, 301, __pyx_L3_error)
8678 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
8680 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); __PYX_ERR(0, 301, __pyx_L3_error)
8684 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8686 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); __PYX_ERR(0, 301, __pyx_L3_error)
8690 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8692 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); __PYX_ERR(0, 301, __pyx_L3_error)
8696 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8698 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); __PYX_ERR(0, 301, __pyx_L3_error)
8702 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8704 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); __PYX_ERR(0, 301, __pyx_L3_error)
8708 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8710 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); __PYX_ERR(0, 301, __pyx_L3_error)
8714 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
8716 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); __PYX_ERR(0, 301, __pyx_L3_error)
8720 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
8722 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); __PYX_ERR(0, 301, __pyx_L3_error)
8725 if (unlikely(kw_args > 0)) {
8726 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
8728 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
8729 goto __pyx_L5_argtuple_error;
8731 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8732 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8733 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8734 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8735 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8736 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8737 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8738 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8739 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8740 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8741 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8742 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8744 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
8745 __pyx_v_gravity = ((PyArrayObject *)values[1]);
8746 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
8747 __pyx_v_colind = ((PyArrayObject *)values[3]);
8748 __pyx_v_KWs = ((PyArrayObject *)values[4]);
8749 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
8750 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
8751 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
8752 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
8753 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
8754 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
8755 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
8757 goto __pyx_L4_argument_unpacking_done;
8758 __pyx_L5_argtuple_error:;
8759 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
8761 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8762 __Pyx_RefNannyFinishContext();
8764 __pyx_L4_argument_unpacking_done:;
8765 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
8766 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
8767 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
8768 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
8769 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 310, __pyx_L1_error)
8770 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
8771 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
8772 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
8773 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
8780 __Pyx_RefNannyFinishContext();
8784 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
8786 int __pyx_v_eN_neighbor;
8791 int __pyx_v_matID_neig;
8792 CYTHON_UNUSED
int __pyx_v_nSpace2;
8794 PyArrayObject *__pyx_v_a_eN = 0;
8795 PyArrayObject *__pyx_v_a_neig = 0;
8796 PyArrayObject *__pyx_v_a_avg = 0;
8797 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
8798 __Pyx_Buffer __pyx_pybuffer_KWs;
8799 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
8800 __Pyx_Buffer __pyx_pybuffer_a_avg;
8801 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
8802 __Pyx_Buffer __pyx_pybuffer_a_eN;
8803 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
8804 __Pyx_Buffer __pyx_pybuffer_a_neig;
8805 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
8806 __Pyx_Buffer __pyx_pybuffer_colind;
8807 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
8808 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
8809 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
8810 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
8811 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
8812 __Pyx_Buffer __pyx_pybuffer_gravity;
8813 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
8814 __Pyx_Buffer __pyx_pybuffer_q_alin;
8815 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
8816 __Pyx_Buffer __pyx_pybuffer_q_flin;
8817 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
8818 __Pyx_Buffer __pyx_pybuffer_rowptr;
8819 PyObject *__pyx_r = NULL;
8820 __Pyx_RefNannyDeclarations
8821 Py_ssize_t __pyx_t_1;
8823 PyObject *__pyx_t_3 = NULL;
8824 PyObject *__pyx_t_4 = NULL;
8825 PyObject *__pyx_t_5 = NULL;
8826 PyObject *__pyx_t_6 = NULL;
8827 PyObject *__pyx_t_7 = NULL;
8828 PyArrayObject *__pyx_t_8 = NULL;
8829 PyArrayObject *__pyx_t_9 = NULL;
8830 PyArrayObject *__pyx_t_10 = NULL;
8833 Py_ssize_t __pyx_t_13;
8837 Py_ssize_t __pyx_t_17;
8838 Py_ssize_t __pyx_t_18;
8840 Py_ssize_t __pyx_t_20;
8841 Py_ssize_t __pyx_t_21;
8842 Py_ssize_t __pyx_t_22;
8845 Py_ssize_t __pyx_t_25;
8847 Py_ssize_t __pyx_t_27;
8849 Py_ssize_t __pyx_t_29;
8850 Py_ssize_t __pyx_t_30;
8851 Py_ssize_t __pyx_t_31;
8852 Py_ssize_t __pyx_t_32;
8853 Py_ssize_t __pyx_t_33;
8854 Py_ssize_t __pyx_t_34;
8855 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_35;
8856 Py_ssize_t __pyx_t_36;
8857 Py_ssize_t __pyx_t_37;
8858 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_38;
8859 Py_ssize_t __pyx_t_39;
8860 Py_ssize_t __pyx_t_40;
8861 Py_ssize_t __pyx_t_41;
8862 Py_ssize_t __pyx_t_42;
8863 Py_ssize_t __pyx_t_43;
8864 Py_ssize_t __pyx_t_44;
8865 Py_ssize_t __pyx_t_45;
8866 Py_ssize_t __pyx_t_46;
8867 Py_ssize_t __pyx_t_47;
8868 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_48;
8869 Py_ssize_t __pyx_t_49;
8870 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_50;
8871 Py_ssize_t __pyx_t_51;
8873 Py_ssize_t __pyx_t_53;
8874 Py_ssize_t __pyx_t_54;
8875 Py_ssize_t __pyx_t_55;
8876 Py_ssize_t __pyx_t_56;
8877 Py_ssize_t __pyx_t_57;
8878 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
8879 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
8880 __pyx_pybuffer_a_eN.refcount = 0;
8881 __pyx_pybuffernd_a_eN.data = NULL;
8882 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
8883 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
8884 __pyx_pybuffer_a_neig.refcount = 0;
8885 __pyx_pybuffernd_a_neig.data = NULL;
8886 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
8887 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
8888 __pyx_pybuffer_a_avg.refcount = 0;
8889 __pyx_pybuffernd_a_avg.data = NULL;
8890 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
8891 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
8892 __pyx_pybuffer_gravity.refcount = 0;
8893 __pyx_pybuffernd_gravity.data = NULL;
8894 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
8895 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
8896 __pyx_pybuffer_rowptr.refcount = 0;
8897 __pyx_pybuffernd_rowptr.data = NULL;
8898 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
8899 __pyx_pybuffer_colind.pybuffer.buf = NULL;
8900 __pyx_pybuffer_colind.refcount = 0;
8901 __pyx_pybuffernd_colind.data = NULL;
8902 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
8903 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
8904 __pyx_pybuffer_KWs.refcount = 0;
8905 __pyx_pybuffernd_KWs.data = NULL;
8906 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
8907 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
8908 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
8909 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
8910 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
8911 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
8912 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
8913 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
8914 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
8915 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
8916 __pyx_pybuffer_q_flin.refcount = 0;
8917 __pyx_pybuffernd_q_flin.data = NULL;
8918 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
8919 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
8920 __pyx_pybuffer_q_alin.refcount = 0;
8921 __pyx_pybuffernd_q_alin.data = NULL;
8922 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
8924 __Pyx_BufFmt_StackElem __pyx_stack[1];
8925 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8927 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
8929 __Pyx_BufFmt_StackElem __pyx_stack[1];
8930 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8932 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
8934 __Pyx_BufFmt_StackElem __pyx_stack[1];
8935 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8937 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
8939 __Pyx_BufFmt_StackElem __pyx_stack[1];
8940 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8942 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
8944 __Pyx_BufFmt_StackElem __pyx_stack[1];
8945 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8947 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
8949 __Pyx_BufFmt_StackElem __pyx_stack[1];
8950 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8952 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
8954 __Pyx_BufFmt_StackElem __pyx_stack[1];
8955 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8957 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
8959 __Pyx_BufFmt_StackElem __pyx_stack[1];
8960 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8962 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
8971 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
8980 __pyx_t_1 = __pyx_v_nSpace;
8982 if (__pyx_t_1 < 0) {
8983 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
8984 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
8985 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
8986 if (unlikely(__pyx_t_2 != -1)) {
8987 __Pyx_RaiseBufferIndexError(__pyx_t_2);
8988 __PYX_ERR(0, 329, __pyx_L1_error)
8990 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
8999 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9000 __Pyx_GOTREF(__pyx_t_4);
9001 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
9002 __Pyx_GOTREF(__pyx_t_5);
9003 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9004 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9005 __Pyx_GOTREF(__pyx_t_4);
9008 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9009 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9010 if (likely(__pyx_t_6)) {
9011 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9012 __Pyx_INCREF(__pyx_t_6);
9013 __Pyx_INCREF(
function);
9014 __Pyx_DECREF_SET(__pyx_t_5,
function);
9018 #if CYTHON_FAST_PYCALL
9019 if (PyFunction_Check(__pyx_t_5)) {
9020 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9021 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9022 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9023 __Pyx_GOTREF(__pyx_t_3);
9024 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9027 #if CYTHON_FAST_PYCCALL
9028 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9029 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9030 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9031 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9032 __Pyx_GOTREF(__pyx_t_3);
9033 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9037 __pyx_t_7 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
9038 __Pyx_GOTREF(__pyx_t_7);
9040 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
9042 __Pyx_GIVEREF(__pyx_t_4);
9043 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_4);
9044 __Pyx_INCREF(__pyx_n_s_d);
9045 __Pyx_GIVEREF(__pyx_n_s_d);
9046 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_d);
9048 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9049 __Pyx_GOTREF(__pyx_t_3);
9050 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9052 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9053 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
9054 __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
9056 __Pyx_BufFmt_StackElem __pyx_stack[1];
9057 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9058 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
9059 __PYX_ERR(0, 331, __pyx_L1_error)
9060 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
9064 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
9074 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9075 __Pyx_GOTREF(__pyx_t_5);
9076 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
9077 __Pyx_GOTREF(__pyx_t_7);
9078 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9079 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9080 __Pyx_GOTREF(__pyx_t_5);
9083 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9084 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
9085 if (likely(__pyx_t_4)) {
9086 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
9087 __Pyx_INCREF(__pyx_t_4);
9088 __Pyx_INCREF(
function);
9089 __Pyx_DECREF_SET(__pyx_t_7,
function);
9093 #if CYTHON_FAST_PYCALL
9094 if (PyFunction_Check(__pyx_t_7)) {
9095 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9096 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9097 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9098 __Pyx_GOTREF(__pyx_t_3);
9099 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9102 #if CYTHON_FAST_PYCCALL
9103 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9104 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9105 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9106 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9107 __Pyx_GOTREF(__pyx_t_3);
9108 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9112 __pyx_t_6 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
9113 __Pyx_GOTREF(__pyx_t_6);
9115 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
9117 __Pyx_GIVEREF(__pyx_t_5);
9118 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_5);
9119 __Pyx_INCREF(__pyx_n_s_d);
9120 __Pyx_GIVEREF(__pyx_n_s_d);
9121 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_n_s_d);
9123 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9124 __Pyx_GOTREF(__pyx_t_3);
9125 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9127 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9128 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
9129 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
9131 __Pyx_BufFmt_StackElem __pyx_stack[1];
9132 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9133 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
9134 __PYX_ERR(0, 332, __pyx_L1_error)
9135 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
9139 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
9149 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9150 __Pyx_GOTREF(__pyx_t_7);
9151 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
9152 __Pyx_GOTREF(__pyx_t_6);
9153 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9154 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9155 __Pyx_GOTREF(__pyx_t_7);
9158 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9159 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9160 if (likely(__pyx_t_5)) {
9161 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
9162 __Pyx_INCREF(__pyx_t_5);
9163 __Pyx_INCREF(
function);
9164 __Pyx_DECREF_SET(__pyx_t_6,
function);
9168 #if CYTHON_FAST_PYCALL
9169 if (PyFunction_Check(__pyx_t_6)) {
9170 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9171 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9172 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9173 __Pyx_GOTREF(__pyx_t_3);
9174 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9177 #if CYTHON_FAST_PYCCALL
9178 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9179 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9180 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9181 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9182 __Pyx_GOTREF(__pyx_t_3);
9183 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9187 __pyx_t_4 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
9188 __Pyx_GOTREF(__pyx_t_4);
9190 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
9192 __Pyx_GIVEREF(__pyx_t_7);
9193 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_7);
9194 __Pyx_INCREF(__pyx_n_s_d);
9195 __Pyx_GIVEREF(__pyx_n_s_d);
9196 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_n_s_d);
9198 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9199 __Pyx_GOTREF(__pyx_t_3);
9200 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9202 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9203 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
9204 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
9206 __Pyx_BufFmt_StackElem __pyx_stack[1];
9207 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9208 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
9209 __PYX_ERR(0, 333, __pyx_L1_error)
9210 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
9214 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
9224 __pyx_t_2 = __pyx_v_nElements_global;
9225 __pyx_t_11 = __pyx_t_2;
9226 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9227 __pyx_v_eN = __pyx_t_12;
9236 __pyx_t_13 = __pyx_v_eN;
9238 if (__pyx_t_13 < 0) {
9239 __pyx_t_13 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9240 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
9241 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_14 = 0;
9242 if (unlikely(__pyx_t_14 != -1)) {
9243 __Pyx_RaiseBufferIndexError(__pyx_t_14);
9244 __PYX_ERR(0, 337, __pyx_L1_error)
9246 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9255 __pyx_t_14 = __pyx_v_nnz;
9256 __pyx_t_15 = __pyx_t_14;
9257 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
9258 __pyx_v_ii = __pyx_t_16;
9267 __pyx_t_17 = __pyx_v_matID;
9268 __pyx_t_18 = __pyx_v_ii;
9270 if (__pyx_t_17 < 0) {
9271 __pyx_t_17 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9272 if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 0;
9273 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_19 = 0;
9274 if (__pyx_t_18 < 0) {
9275 __pyx_t_18 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9276 if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 1;
9277 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_19 = 1;
9278 if (unlikely(__pyx_t_19 != -1)) {
9279 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9280 __PYX_ERR(0, 339, __pyx_L1_error)
9282 __pyx_t_20 = __pyx_v_ii;
9284 if (__pyx_t_20 < 0) {
9285 __pyx_t_20 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9286 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
9287 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_19 = 0;
9288 if (unlikely(__pyx_t_19 != -1)) {
9289 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9290 __PYX_ERR(0, 339, __pyx_L1_error)
9292 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9302 __pyx_t_14 = __pyx_v_nElementBoundaries_element;
9303 __pyx_t_15 = __pyx_t_14;
9304 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
9305 __pyx_v_ebN = __pyx_t_16;
9314 __pyx_t_21 = __pyx_v_eN;
9315 __pyx_t_22 = __pyx_v_ebN;
9317 if (__pyx_t_21 < 0) {
9318 __pyx_t_21 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
9319 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0;
9320 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_19 = 0;
9321 if (__pyx_t_22 < 0) {
9322 __pyx_t_22 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
9323 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 1;
9324 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_19 = 1;
9325 if (unlikely(__pyx_t_19 != -1)) {
9326 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9327 __PYX_ERR(0, 341, __pyx_L1_error)
9329 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
9338 __pyx_t_19 = __pyx_v_nnz;
9339 __pyx_t_23 = __pyx_t_19;
9340 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9341 __pyx_v_ii = __pyx_t_24;
9350 __pyx_t_25 = __pyx_v_ii;
9352 if (__pyx_t_25 < 0) {
9353 __pyx_t_25 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9354 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 0;
9355 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_26 = 0;
9356 if (unlikely(__pyx_t_26 != -1)) {
9357 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9358 __PYX_ERR(0, 343, __pyx_L1_error)
9360 __pyx_t_27 = __pyx_v_ii;
9362 if (__pyx_t_27 < 0) {
9363 __pyx_t_27 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9364 if (unlikely(__pyx_t_27 < 0)) __pyx_t_26 = 0;
9365 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9366 if (unlikely(__pyx_t_26 != -1)) {
9367 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9368 __PYX_ERR(0, 343, __pyx_L1_error)
9370 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a_eN.diminfo[0].strides));
9380 __pyx_t_28 = ((__pyx_v_eN_neighbor >= 0) != 0);
9390 __pyx_t_29 = __pyx_v_eN_neighbor;
9392 if (__pyx_t_29 < 0) {
9393 __pyx_t_29 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9394 if (unlikely(__pyx_t_29 < 0)) __pyx_t_19 = 0;
9395 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_19 = 0;
9396 if (unlikely(__pyx_t_19 != -1)) {
9397 __Pyx_RaiseBufferIndexError(__pyx_t_19);
9398 __PYX_ERR(0, 345, __pyx_L1_error)
9400 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9409 __pyx_t_19 = __pyx_v_nnz;
9410 __pyx_t_23 = __pyx_t_19;
9411 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9412 __pyx_v_ii = __pyx_t_24;
9421 __pyx_t_30 = __pyx_v_matID_neig;
9422 __pyx_t_31 = __pyx_v_ii;
9424 if (__pyx_t_30 < 0) {
9425 __pyx_t_30 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9426 if (unlikely(__pyx_t_30 < 0)) __pyx_t_26 = 0;
9427 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_26 = 0;
9428 if (__pyx_t_31 < 0) {
9429 __pyx_t_31 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9430 if (unlikely(__pyx_t_31 < 0)) __pyx_t_26 = 1;
9431 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_26 = 1;
9432 if (unlikely(__pyx_t_26 != -1)) {
9433 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9434 __PYX_ERR(0, 347, __pyx_L1_error)
9436 __pyx_t_32 = __pyx_v_ii;
9438 if (__pyx_t_32 < 0) {
9439 __pyx_t_32 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9440 if (unlikely(__pyx_t_32 < 0)) __pyx_t_26 = 0;
9441 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9442 if (unlikely(__pyx_t_26 != -1)) {
9443 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9444 __PYX_ERR(0, 347, __pyx_L1_error)
9446 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9465 __pyx_t_19 = __pyx_v_nnz;
9466 __pyx_t_23 = __pyx_t_19;
9467 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9468 __pyx_v_ii = __pyx_t_24;
9477 __pyx_t_33 = __pyx_v_ii;
9479 if (__pyx_t_33 < 0) {
9480 __pyx_t_33 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9481 if (unlikely(__pyx_t_33 < 0)) __pyx_t_26 = 0;
9482 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_26 = 0;
9483 if (unlikely(__pyx_t_26 != -1)) {
9484 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9485 __PYX_ERR(0, 349, __pyx_L1_error)
9487 __pyx_t_34 = __pyx_v_ii;
9489 if (__pyx_t_34 < 0) {
9490 __pyx_t_34 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9491 if (unlikely(__pyx_t_34 < 0)) __pyx_t_26 = 0;
9492 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9493 if (unlikely(__pyx_t_26 != -1)) {
9494 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9495 __PYX_ERR(0, 349, __pyx_L1_error)
9497 __pyx_t_35 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
9498 __pyx_t_36 = __pyx_v_ii;
9500 if (__pyx_t_36 < 0) {
9501 __pyx_t_36 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9502 if (unlikely(__pyx_t_36 < 0)) __pyx_t_26 = 0;
9503 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_26 = 0;
9504 if (unlikely(__pyx_t_26 != -1)) {
9505 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9506 __PYX_ERR(0, 349, __pyx_L1_error)
9508 __pyx_t_37 = __pyx_v_ii;
9510 if (__pyx_t_37 < 0) {
9511 __pyx_t_37 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9512 if (unlikely(__pyx_t_37 < 0)) __pyx_t_26 = 0;
9513 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_26 = 0;
9514 if (unlikely(__pyx_t_26 != -1)) {
9515 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9516 __PYX_ERR(0, 349, __pyx_L1_error)
9518 __pyx_t_38 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
9519 if (unlikely(__pyx_t_38 == 0)) {
9520 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9521 __PYX_ERR(0, 349, __pyx_L1_error)
9523 __pyx_t_39 = __pyx_v_ii;
9525 if (__pyx_t_39 < 0) {
9526 __pyx_t_39 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9527 if (unlikely(__pyx_t_39 < 0)) __pyx_t_26 = 0;
9528 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_26 = 0;
9529 if (unlikely(__pyx_t_26 != -1)) {
9530 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9531 __PYX_ERR(0, 349, __pyx_L1_error)
9533 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_35 / __pyx_t_38);
9542 __pyx_t_40 = __pyx_v_ii;
9544 if (__pyx_t_40 < 0) {
9545 __pyx_t_40 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9546 if (unlikely(__pyx_t_40 < 0)) __pyx_t_26 = 0;
9547 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_26 = 0;
9548 if (unlikely(__pyx_t_26 != -1)) {
9549 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9550 __PYX_ERR(0, 350, __pyx_L1_error)
9552 __pyx_t_41 = __pyx_v_eN;
9553 __pyx_t_42 = __pyx_v_ebN;
9554 __pyx_t_43 = __pyx_v_ii;
9556 if (__pyx_t_41 < 0) {
9557 __pyx_t_41 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
9558 if (unlikely(__pyx_t_41 < 0)) __pyx_t_26 = 0;
9559 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_26 = 0;
9560 if (__pyx_t_42 < 0) {
9561 __pyx_t_42 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
9562 if (unlikely(__pyx_t_42 < 0)) __pyx_t_26 = 1;
9563 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_26 = 1;
9564 if (__pyx_t_43 < 0) {
9565 __pyx_t_43 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
9566 if (unlikely(__pyx_t_43 < 0)) __pyx_t_26 = 2;
9567 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_26 = 2;
9568 if (unlikely(__pyx_t_26 != -1)) {
9569 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9570 __PYX_ERR(0, 350, __pyx_L1_error)
9572 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_a_avg.diminfo[0].strides));
9582 __pyx_t_19 = __pyx_v_nSpace;
9583 __pyx_t_23 = __pyx_t_19;
9584 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
9585 __pyx_v_I = __pyx_t_24;
9594 __pyx_t_44 = __pyx_v_eN;
9595 __pyx_t_45 = __pyx_v_ebN;
9596 __pyx_t_46 = __pyx_v_I;
9598 if (__pyx_t_44 < 0) {
9599 __pyx_t_44 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9600 if (unlikely(__pyx_t_44 < 0)) __pyx_t_26 = 0;
9601 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_26 = 0;
9602 if (__pyx_t_45 < 0) {
9603 __pyx_t_45 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9604 if (unlikely(__pyx_t_45 < 0)) __pyx_t_26 = 1;
9605 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_26 = 1;
9606 if (__pyx_t_46 < 0) {
9607 __pyx_t_46 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9608 if (unlikely(__pyx_t_46 < 0)) __pyx_t_26 = 2;
9609 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_26 = 2;
9610 if (unlikely(__pyx_t_26 != -1)) {
9611 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9612 __PYX_ERR(0, 352, __pyx_L1_error)
9614 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
9623 __pyx_t_47 = (__pyx_v_I + 1);
9625 if (__pyx_t_47 < 0) {
9626 __pyx_t_47 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9627 if (unlikely(__pyx_t_47 < 0)) __pyx_t_26 = 0;
9628 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_26 = 0;
9629 if (unlikely(__pyx_t_26 != -1)) {
9630 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9631 __PYX_ERR(0, 353, __pyx_L1_error)
9633 __pyx_t_48 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9634 __pyx_t_49 = __pyx_v_I;
9636 if (__pyx_t_49 < 0) {
9637 __pyx_t_49 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9638 if (unlikely(__pyx_t_49 < 0)) __pyx_t_26 = 0;
9639 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_26 = 0;
9640 if (unlikely(__pyx_t_26 != -1)) {
9641 __Pyx_RaiseBufferIndexError(__pyx_t_26);
9642 __PYX_ERR(0, 353, __pyx_L1_error)
9644 __pyx_t_50 = __pyx_t_48;
9645 for (__pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_26 < __pyx_t_50; __pyx_t_26+=1) {
9646 __pyx_v_ii = __pyx_t_26;
9655 __pyx_t_51 = __pyx_v_ii;
9657 if (__pyx_t_51 < 0) {
9658 __pyx_t_51 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9659 if (unlikely(__pyx_t_51 < 0)) __pyx_t_52 = 0;
9660 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_52 = 0;
9661 if (unlikely(__pyx_t_52 != -1)) {
9662 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9663 __PYX_ERR(0, 354, __pyx_L1_error)
9665 __pyx_t_53 = __pyx_v_ii;
9667 if (__pyx_t_53 < 0) {
9668 __pyx_t_53 += __pyx_pybuffernd_colind.diminfo[0].shape;
9669 if (unlikely(__pyx_t_53 < 0)) __pyx_t_52 = 0;
9670 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_52 = 0;
9671 if (unlikely(__pyx_t_52 != -1)) {
9672 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9673 __PYX_ERR(0, 354, __pyx_L1_error)
9675 __pyx_t_54 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_colind.diminfo[0].strides));
9677 if (__pyx_t_54 < 0) {
9678 __pyx_t_54 += __pyx_pybuffernd_gravity.diminfo[0].shape;
9679 if (unlikely(__pyx_t_54 < 0)) __pyx_t_52 = 0;
9680 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_52 = 0;
9681 if (unlikely(__pyx_t_52 != -1)) {
9682 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9683 __PYX_ERR(0, 354, __pyx_L1_error)
9685 __pyx_t_55 = __pyx_v_eN;
9686 __pyx_t_56 = __pyx_v_ebN;
9687 __pyx_t_57 = __pyx_v_I;
9689 if (__pyx_t_55 < 0) {
9690 __pyx_t_55 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9691 if (unlikely(__pyx_t_55 < 0)) __pyx_t_52 = 0;
9692 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_52 = 0;
9693 if (__pyx_t_56 < 0) {
9694 __pyx_t_56 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9695 if (unlikely(__pyx_t_56 < 0)) __pyx_t_52 = 1;
9696 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_52 = 1;
9697 if (__pyx_t_57 < 0) {
9698 __pyx_t_57 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9699 if (unlikely(__pyx_t_57 < 0)) __pyx_t_52 = 2;
9700 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_52 = 2;
9701 if (unlikely(__pyx_t_52 != -1)) {
9702 __Pyx_RaiseBufferIndexError(__pyx_t_52);
9703 __PYX_ERR(0, 354, __pyx_L1_error)
9705 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_gravity.diminfo[0].strides)));
9720 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9723 __Pyx_XDECREF(__pyx_t_3);
9724 __Pyx_XDECREF(__pyx_t_4);
9725 __Pyx_XDECREF(__pyx_t_5);
9726 __Pyx_XDECREF(__pyx_t_6);
9727 __Pyx_XDECREF(__pyx_t_7);
9728 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9729 __Pyx_PyThreadState_declare
9730 __Pyx_PyThreadState_assign
9731 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9732 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9733 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9734 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9735 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9736 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9737 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9738 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9739 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9740 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9741 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9742 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9743 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9744 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
9748 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9749 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9750 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9751 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9752 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9753 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9754 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9755 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9756 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9757 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9758 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9760 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
9761 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
9762 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
9763 __Pyx_XGIVEREF(__pyx_r);
9764 __Pyx_RefNannyFinishContext();
9777 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9778 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
9779 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
9780 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9782 double __pyx_v_beta;
9783 PyArrayObject *__pyx_v_gravity = 0;
9784 PyArrayObject *__pyx_v_alpha = 0;
9785 PyArrayObject *__pyx_v_n = 0;
9786 PyArrayObject *__pyx_v_thetaR = 0;
9787 PyArrayObject *__pyx_v_thetaSR = 0;
9789 int __pyx_v_nElements_global;
9790 int __pyx_v_nElementBoundaries_element;
9791 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
9792 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
9793 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9794 int __pyx_v_nDOF_trial_element;
9795 PyArrayObject *__pyx_v_u_l2g = 0;
9796 PyArrayObject *__pyx_v_u_dof = 0;
9797 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
9798 PyArrayObject *__pyx_v_q_u = 0;
9799 PyArrayObject *__pyx_v_q_mass = 0;
9800 PyArrayObject *__pyx_v_q_dmass = 0;
9801 PyArrayObject *__pyx_v_q_r = 0;
9802 PyArrayObject *__pyx_v_q_kr = 0;
9803 PyArrayObject *__pyx_v_q_dkr = 0;
9804 PyArrayObject *__pyx_v_q_kr_up = 0;
9805 PyObject *__pyx_r = 0;
9806 __Pyx_RefNannyDeclarations
9807 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
9809 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
9810 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
9811 if (unlikely(__pyx_kwds)) {
9813 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9815 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9817 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9819 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9821 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9823 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9825 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9827 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9829 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9831 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9833 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9835 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9837 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9839 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9841 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9843 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9845 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9847 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9849 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9851 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9853 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9855 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9857 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9859 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9861 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9864 default:
goto __pyx_L5_argtuple_error;
9866 kw_args = PyDict_Size(__pyx_kwds);
9869 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
9870 else goto __pyx_L5_argtuple_error;
9873 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
9875 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); __PYX_ERR(0, 359, __pyx_L3_error)
9879 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
9881 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); __PYX_ERR(0, 359, __pyx_L3_error)
9885 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
9887 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); __PYX_ERR(0, 359, __pyx_L3_error)
9891 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
9893 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); __PYX_ERR(0, 359, __pyx_L3_error)
9897 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
9899 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); __PYX_ERR(0, 359, __pyx_L3_error)
9903 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
9905 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); __PYX_ERR(0, 359, __pyx_L3_error)
9909 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
9911 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); __PYX_ERR(0, 359, __pyx_L3_error)
9915 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
9917 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); __PYX_ERR(0, 359, __pyx_L3_error)
9921 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
9923 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); __PYX_ERR(0, 359, __pyx_L3_error)
9927 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
9929 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); __PYX_ERR(0, 359, __pyx_L3_error)
9933 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
9935 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); __PYX_ERR(0, 359, __pyx_L3_error)
9939 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
9941 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); __PYX_ERR(0, 359, __pyx_L3_error)
9945 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
9947 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); __PYX_ERR(0, 359, __pyx_L3_error)
9951 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
9953 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); __PYX_ERR(0, 359, __pyx_L3_error)
9957 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
9959 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); __PYX_ERR(0, 359, __pyx_L3_error)
9963 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
9965 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); __PYX_ERR(0, 359, __pyx_L3_error)
9969 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
9971 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); __PYX_ERR(0, 359, __pyx_L3_error)
9975 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
9977 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); __PYX_ERR(0, 359, __pyx_L3_error)
9981 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
9983 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); __PYX_ERR(0, 359, __pyx_L3_error)
9987 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
9989 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); __PYX_ERR(0, 359, __pyx_L3_error)
9993 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
9995 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); __PYX_ERR(0, 359, __pyx_L3_error)
9999 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
10001 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); __PYX_ERR(0, 359, __pyx_L3_error)
10003 CYTHON_FALLTHROUGH;
10005 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
10007 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); __PYX_ERR(0, 359, __pyx_L3_error)
10010 if (unlikely(kw_args > 0)) {
10011 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
10013 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
10014 goto __pyx_L5_argtuple_error;
10016 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10017 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10018 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10019 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10020 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10021 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10022 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10023 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10024 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10025 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10026 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10027 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10028 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10029 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10030 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10031 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10032 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10033 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10034 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10035 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10036 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10037 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10038 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10039 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10041 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
10042 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
10043 __pyx_v_gravity = ((PyArrayObject *)values[2]);
10044 __pyx_v_alpha = ((PyArrayObject *)values[3]);
10045 __pyx_v_n = ((PyArrayObject *)values[4]);
10046 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
10047 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
10048 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
10049 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
10050 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
10051 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
10052 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
10053 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
10054 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L3_error)
10055 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
10056 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
10057 __pyx_v_q_x = ((PyArrayObject *)values[16]);
10058 __pyx_v_q_u = ((PyArrayObject *)values[17]);
10059 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
10060 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
10061 __pyx_v_q_r = ((PyArrayObject *)values[20]);
10062 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
10063 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
10064 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
10066 goto __pyx_L4_argument_unpacking_done;
10067 __pyx_L5_argtuple_error:;
10068 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
10070 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
10071 __Pyx_RefNannyFinishContext();
10073 __pyx_L4_argument_unpacking_done:;
10074 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 361, __pyx_L1_error)
10075 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
10076 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
10077 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
10078 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
10079 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
10080 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
10081 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
10082 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
10083 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
10084 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) __PYX_ERR(0, 378, __pyx_L1_error)
10085 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
10086 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
10087 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
10088 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
10089 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
10090 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
10091 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
10092 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
10099 __Pyx_RefNannyFinishContext();
10103 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
10104 PyObject *__pyx_v_q = NULL;
10105 double __pyx_v_psiC;
10106 double __pyx_v_pcBar;
10107 double __pyx_v_pcBar_n;
10108 double __pyx_v_pcBar_nM1;
10109 double __pyx_v_pcBar_nM2;
10110 double __pyx_v_onePlus_pcBar_n;
10111 double __pyx_v_sBar;
10112 double __pyx_v_sqrt_sBar;
10113 double __pyx_v_DsBar_DpsiC;
10114 double __pyx_v_thetaW;
10115 double __pyx_v_DthetaW_DpsiC;
10116 double __pyx_v_vBar;
10117 double __pyx_v_vBar2;
10118 double __pyx_v_DvBar_DpsiC;
10119 double __pyx_v_KWr;
10120 double __pyx_v_DKWr_DpsiC;
10121 CYTHON_UNUSED
double __pyx_v_rho2;
10122 double __pyx_v_thetaS;
10123 double __pyx_v_rhom;
10124 double __pyx_v_drhom;
10126 double __pyx_v_u_j;
10127 double __pyx_v_u_eN;
10128 double __pyx_v_u_neig;
10129 double __pyx_v_kr_eN;
10130 double __pyx_v_kr_neig;
10131 double __pyx_v_phi_eN;
10132 double __pyx_v_phi_neig;
10134 int __pyx_v_eN_neighbor;
10138 double __pyx_v_nAvgWeight;
10139 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
10140 __Pyx_Buffer __pyx_pybuffer_alpha;
10141 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
10142 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
10143 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
10144 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
10145 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
10146 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
10147 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
10148 __Pyx_Buffer __pyx_pybuffer_gravity;
10149 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
10150 __Pyx_Buffer __pyx_pybuffer_n;
10151 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
10152 __Pyx_Buffer __pyx_pybuffer_q_dkr;
10153 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
10154 __Pyx_Buffer __pyx_pybuffer_q_dmass;
10155 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
10156 __Pyx_Buffer __pyx_pybuffer_q_kr;
10157 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
10158 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
10159 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
10160 __Pyx_Buffer __pyx_pybuffer_q_mass;
10161 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
10162 __Pyx_Buffer __pyx_pybuffer_q_r;
10163 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
10164 __Pyx_Buffer __pyx_pybuffer_q_u;
10165 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
10166 __Pyx_Buffer __pyx_pybuffer_q_x;
10167 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
10168 __Pyx_Buffer __pyx_pybuffer_thetaR;
10169 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
10170 __Pyx_Buffer __pyx_pybuffer_thetaSR;
10171 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
10172 __Pyx_Buffer __pyx_pybuffer_u_dof;
10173 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
10174 __Pyx_Buffer __pyx_pybuffer_u_l2g;
10175 PyObject *__pyx_r = NULL;
10176 __Pyx_RefNannyDeclarations
10177 PyObject *__pyx_t_1 = NULL;
10178 PyObject *__pyx_t_2 = NULL;
10179 Py_ssize_t __pyx_t_3;
10180 PyObject *__pyx_t_4 = NULL;
10181 PyObject *__pyx_t_5 = NULL;
10187 Py_ssize_t __pyx_t_11;
10191 Py_ssize_t __pyx_t_15;
10192 Py_ssize_t __pyx_t_16;
10194 Py_ssize_t __pyx_t_18;
10195 Py_ssize_t __pyx_t_19;
10196 Py_ssize_t __pyx_t_20;
10197 Py_ssize_t __pyx_t_21;
10198 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_22;
10199 Py_ssize_t __pyx_t_23;
10200 Py_ssize_t __pyx_t_24;
10201 Py_ssize_t __pyx_t_25;
10202 Py_ssize_t __pyx_t_26;
10203 Py_ssize_t __pyx_t_27;
10204 Py_ssize_t __pyx_t_28;
10205 Py_ssize_t __pyx_t_29;
10206 Py_ssize_t __pyx_t_30;
10207 Py_ssize_t __pyx_t_31;
10208 Py_ssize_t __pyx_t_32;
10209 Py_ssize_t __pyx_t_33;
10210 Py_ssize_t __pyx_t_34;
10211 Py_ssize_t __pyx_t_35;
10212 Py_ssize_t __pyx_t_36;
10213 Py_ssize_t __pyx_t_37;
10214 Py_ssize_t __pyx_t_38;
10215 Py_ssize_t __pyx_t_39;
10216 Py_ssize_t __pyx_t_40;
10217 Py_ssize_t __pyx_t_41;
10218 PyObject *__pyx_t_42 = NULL;
10219 PyObject *__pyx_t_43 = NULL;
10220 Py_ssize_t __pyx_t_44;
10221 Py_ssize_t __pyx_t_45;
10222 Py_ssize_t __pyx_t_46;
10223 Py_ssize_t __pyx_t_47;
10224 Py_ssize_t __pyx_t_48;
10225 Py_ssize_t __pyx_t_49;
10226 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
10227 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
10228 __pyx_pybuffer_gravity.refcount = 0;
10229 __pyx_pybuffernd_gravity.data = NULL;
10230 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
10231 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
10232 __pyx_pybuffer_alpha.refcount = 0;
10233 __pyx_pybuffernd_alpha.data = NULL;
10234 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
10235 __pyx_pybuffer_n.pybuffer.buf = NULL;
10236 __pyx_pybuffer_n.refcount = 0;
10237 __pyx_pybuffernd_n.data = NULL;
10238 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
10239 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
10240 __pyx_pybuffer_thetaR.refcount = 0;
10241 __pyx_pybuffernd_thetaR.data = NULL;
10242 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
10243 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
10244 __pyx_pybuffer_thetaSR.refcount = 0;
10245 __pyx_pybuffernd_thetaSR.data = NULL;
10246 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
10247 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
10248 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
10249 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
10250 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
10251 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
10252 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
10253 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
10254 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
10255 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
10256 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
10257 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
10258 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
10259 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
10260 __pyx_pybuffer_u_l2g.refcount = 0;
10261 __pyx_pybuffernd_u_l2g.data = NULL;
10262 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
10263 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
10264 __pyx_pybuffer_u_dof.refcount = 0;
10265 __pyx_pybuffernd_u_dof.data = NULL;
10266 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
10267 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
10268 __pyx_pybuffer_q_x.refcount = 0;
10269 __pyx_pybuffernd_q_x.data = NULL;
10270 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
10271 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
10272 __pyx_pybuffer_q_u.refcount = 0;
10273 __pyx_pybuffernd_q_u.data = NULL;
10274 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
10275 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
10276 __pyx_pybuffer_q_mass.refcount = 0;
10277 __pyx_pybuffernd_q_mass.data = NULL;
10278 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
10279 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
10280 __pyx_pybuffer_q_dmass.refcount = 0;
10281 __pyx_pybuffernd_q_dmass.data = NULL;
10282 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
10283 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
10284 __pyx_pybuffer_q_r.refcount = 0;
10285 __pyx_pybuffernd_q_r.data = NULL;
10286 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
10287 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
10288 __pyx_pybuffer_q_kr.refcount = 0;
10289 __pyx_pybuffernd_q_kr.data = NULL;
10290 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
10291 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
10292 __pyx_pybuffer_q_dkr.refcount = 0;
10293 __pyx_pybuffernd_q_dkr.data = NULL;
10294 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
10295 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
10296 __pyx_pybuffer_q_kr_up.refcount = 0;
10297 __pyx_pybuffernd_q_kr_up.data = NULL;
10298 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
10300 __Pyx_BufFmt_StackElem __pyx_stack[1];
10301 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10303 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
10305 __Pyx_BufFmt_StackElem __pyx_stack[1];
10306 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10308 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
10310 __Pyx_BufFmt_StackElem __pyx_stack[1];
10311 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10313 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
10315 __Pyx_BufFmt_StackElem __pyx_stack[1];
10316 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10318 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
10320 __Pyx_BufFmt_StackElem __pyx_stack[1];
10321 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10323 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
10325 __Pyx_BufFmt_StackElem __pyx_stack[1];
10326 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10328 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
10330 __Pyx_BufFmt_StackElem __pyx_stack[1];
10331 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10333 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
10335 __Pyx_BufFmt_StackElem __pyx_stack[1];
10336 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10338 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
10340 __Pyx_BufFmt_StackElem __pyx_stack[1];
10341 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10343 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
10345 __Pyx_BufFmt_StackElem __pyx_stack[1];
10346 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10348 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
10350 __Pyx_BufFmt_StackElem __pyx_stack[1];
10351 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10353 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
10355 __Pyx_BufFmt_StackElem __pyx_stack[1];
10356 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10358 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
10360 __Pyx_BufFmt_StackElem __pyx_stack[1];
10361 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10363 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
10365 __Pyx_BufFmt_StackElem __pyx_stack[1];
10366 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10368 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
10370 __Pyx_BufFmt_StackElem __pyx_stack[1];
10371 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10373 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
10375 __Pyx_BufFmt_StackElem __pyx_stack[1];
10376 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10378 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
10380 __Pyx_BufFmt_StackElem __pyx_stack[1];
10381 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10383 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
10385 __Pyx_BufFmt_StackElem __pyx_stack[1];
10386 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10388 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
10397 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10398 __Pyx_GOTREF(__pyx_t_1);
10399 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
10400 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
10401 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
10402 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
10403 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
10404 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
10405 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
10406 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
10407 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
10408 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
10409 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
10410 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
10411 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
10412 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
10413 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
10414 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10415 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10417 if (__pyx_t_3 >= 5)
break;
10418 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10419 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
10421 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10422 __Pyx_GOTREF(__pyx_t_1);
10424 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
10434 #ifndef CYTHON_WITHOUT_ASSERTIONS
10435 if (unlikely(!Py_OptimizeFlag)) {
10436 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10437 __Pyx_GOTREF(__pyx_t_1);
10438 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
10439 __Pyx_GOTREF(__pyx_t_4);
10440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10441 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10442 __Pyx_GOTREF(__pyx_t_1);
10443 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
10444 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10446 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
10447 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10448 if (unlikely(!__pyx_t_6)) {
10449 PyErr_SetNone(PyExc_AssertionError);
10450 __PYX_ERR(0, 400, __pyx_L1_error)
10463 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10472 #ifndef CYTHON_WITHOUT_ASSERTIONS
10473 if (unlikely(!Py_OptimizeFlag)) {
10474 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
10475 PyErr_SetNone(PyExc_AssertionError);
10476 __PYX_ERR(0, 401, __pyx_L1_error)
10488 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
10497 __pyx_t_7 = (__pyx_v_nSpace + 1.);
10498 if (unlikely(__pyx_t_7 == 0)) {
10499 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10500 __PYX_ERR(0, 409, __pyx_L1_error)
10502 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
10511 __pyx_t_8 = __pyx_v_nElements_global;
10512 __pyx_t_9 = __pyx_t_8;
10513 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10514 __pyx_v_eN = __pyx_t_10;
10523 __pyx_t_11 = __pyx_v_eN;
10525 if (__pyx_t_11 < 0) {
10526 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10527 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
10528 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_12 = 0;
10529 if (unlikely(__pyx_t_12 != -1)) {
10530 __Pyx_RaiseBufferIndexError(__pyx_t_12);
10531 __PYX_ERR(0, 413, __pyx_L1_error)
10533 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
10542 __pyx_t_12 = __pyx_v_nDOF_trial_element;
10543 __pyx_t_13 = __pyx_t_12;
10544 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
10545 __pyx_v_j = __pyx_t_14;
10554 __pyx_t_15 = __pyx_v_eN;
10555 __pyx_t_16 = __pyx_v_j;
10557 if (__pyx_t_15 < 0) {
10558 __pyx_t_15 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
10559 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
10560 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_17 = 0;
10561 if (__pyx_t_16 < 0) {
10562 __pyx_t_16 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
10563 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
10564 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_17 = 1;
10565 if (unlikely(__pyx_t_17 != -1)) {
10566 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10567 __PYX_ERR(0, 415, __pyx_L1_error)
10569 __pyx_t_18 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
10571 if (__pyx_t_18 < 0) {
10572 __pyx_t_18 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
10573 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
10574 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_17 = 0;
10575 if (unlikely(__pyx_t_17 != -1)) {
10576 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10577 __PYX_ERR(0, 415, __pyx_L1_error)
10579 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_u_dof.diminfo[0].strides));
10588 __pyx_t_19 = __pyx_v_eN;
10589 __pyx_t_20 = __pyx_v_j;
10591 if (__pyx_t_19 < 0) {
10592 __pyx_t_19 += __pyx_pybuffernd_q_u.diminfo[0].shape;
10593 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 0;
10594 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_17 = 0;
10595 if (__pyx_t_20 < 0) {
10596 __pyx_t_20 += __pyx_pybuffernd_q_u.diminfo[1].shape;
10597 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 1;
10598 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_17 = 1;
10599 if (unlikely(__pyx_t_17 != -1)) {
10600 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10601 __PYX_ERR(0, 416, __pyx_L1_error)
10603 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
10612 __pyx_v_psiC = (-__pyx_v_u_j);
10621 __pyx_t_21 = __pyx_v_matID;
10623 if (__pyx_t_21 < 0) {
10624 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[0].shape;
10625 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 0;
10626 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10627 if (unlikely(__pyx_t_17 != -1)) {
10628 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10629 __PYX_ERR(0, 420, __pyx_L1_error)
10631 __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_n.diminfo[0].strides));
10632 if (unlikely(__pyx_t_22 == 0)) {
10633 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10634 __PYX_ERR(0, 420, __pyx_L1_error)
10636 __pyx_v_m = (1.0 - (1.0 / __pyx_t_22));
10645 __pyx_t_23 = __pyx_v_matID;
10647 if (__pyx_t_23 < 0) {
10648 __pyx_t_23 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10649 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 0;
10650 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_17 = 0;
10651 if (unlikely(__pyx_t_17 != -1)) {
10652 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10653 __PYX_ERR(0, 421, __pyx_L1_error)
10655 __pyx_t_24 = __pyx_v_matID;
10657 if (__pyx_t_24 < 0) {
10658 __pyx_t_24 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10659 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 0;
10660 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_17 = 0;
10661 if (unlikely(__pyx_t_17 != -1)) {
10662 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10663 __PYX_ERR(0, 421, __pyx_L1_error)
10665 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
10674 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
10684 __pyx_t_25 = __pyx_v_matID;
10686 if (__pyx_t_25 < 0) {
10687 __pyx_t_25 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10688 if (unlikely(__pyx_t_25 < 0)) __pyx_t_17 = 0;
10689 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_17 = 0;
10690 if (unlikely(__pyx_t_17 != -1)) {
10691 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10692 __PYX_ERR(0, 423, __pyx_L1_error)
10694 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
10703 __pyx_t_26 = __pyx_v_matID;
10705 if (__pyx_t_26 < 0) {
10706 __pyx_t_26 += __pyx_pybuffernd_n.diminfo[0].shape;
10707 if (unlikely(__pyx_t_26 < 0)) __pyx_t_17 = 0;
10708 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10709 if (unlikely(__pyx_t_17 != -1)) {
10710 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10711 __PYX_ERR(0, 424, __pyx_L1_error)
10713 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
10722 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
10731 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
10740 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
10749 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
10758 __pyx_t_27 = __pyx_v_matID;
10760 if (__pyx_t_27 < 0) {
10761 __pyx_t_27 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10762 if (unlikely(__pyx_t_27 < 0)) __pyx_t_17 = 0;
10763 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_17 = 0;
10764 if (unlikely(__pyx_t_17 != -1)) {
10765 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10766 __PYX_ERR(0, 431, __pyx_L1_error)
10768 __pyx_t_28 = __pyx_v_matID;
10770 if (__pyx_t_28 < 0) {
10771 __pyx_t_28 += __pyx_pybuffernd_n.diminfo[0].shape;
10772 if (unlikely(__pyx_t_28 < 0)) __pyx_t_17 = 0;
10773 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10774 if (unlikely(__pyx_t_17 != -1)) {
10775 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10776 __PYX_ERR(0, 431, __pyx_L1_error)
10778 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
10779 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10780 __PYX_ERR(0, 431, __pyx_L1_error)
10782 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
10791 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
10800 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
10809 __pyx_t_29 = __pyx_v_matID;
10811 if (__pyx_t_29 < 0) {
10812 __pyx_t_29 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10813 if (unlikely(__pyx_t_29 < 0)) __pyx_t_17 = 0;
10814 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_17 = 0;
10815 if (unlikely(__pyx_t_17 != -1)) {
10816 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10817 __PYX_ERR(0, 435, __pyx_L1_error)
10819 __pyx_t_30 = __pyx_v_matID;
10821 if (__pyx_t_30 < 0) {
10822 __pyx_t_30 += __pyx_pybuffernd_n.diminfo[0].shape;
10823 if (unlikely(__pyx_t_30 < 0)) __pyx_t_17 = 0;
10824 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
10825 if (unlikely(__pyx_t_17 != -1)) {
10826 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10827 __PYX_ERR(0, 435, __pyx_L1_error)
10829 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
10838 __pyx_t_31 = __pyx_v_matID;
10840 if (__pyx_t_31 < 0) {
10841 __pyx_t_31 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10842 if (unlikely(__pyx_t_31 < 0)) __pyx_t_17 = 0;
10843 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_17 = 0;
10844 if (unlikely(__pyx_t_17 != -1)) {
10845 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10846 __PYX_ERR(0, 437, __pyx_L1_error)
10848 __pyx_t_32 = __pyx_v_matID;
10850 if (__pyx_t_32 < 0) {
10851 __pyx_t_32 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10852 if (unlikely(__pyx_t_32 < 0)) __pyx_t_17 = 0;
10853 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_17 = 0;
10854 if (unlikely(__pyx_t_17 != -1)) {
10855 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10856 __PYX_ERR(0, 437, __pyx_L1_error)
10858 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
10867 __pyx_t_33 = __pyx_v_matID;
10869 if (__pyx_t_33 < 0) {
10870 __pyx_t_33 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10871 if (unlikely(__pyx_t_33 < 0)) __pyx_t_17 = 0;
10872 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_17 = 0;
10873 if (unlikely(__pyx_t_17 != -1)) {
10874 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10875 __PYX_ERR(0, 438, __pyx_L1_error)
10877 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
10886 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
10895 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
10904 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
10905 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10906 __PYX_ERR(0, 442, __pyx_L1_error)
10908 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
10928 __pyx_v_thetaW = __pyx_v_thetaS;
10937 __pyx_v_DthetaW_DpsiC = 0.0;
10955 __pyx_v_DKWr_DpsiC = 0.0;
10966 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
10975 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
10984 __pyx_t_34 = __pyx_v_eN;
10985 __pyx_t_35 = __pyx_v_j;
10987 if (__pyx_t_34 < 0) {
10988 __pyx_t_34 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
10989 if (unlikely(__pyx_t_34 < 0)) __pyx_t_17 = 0;
10990 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_17 = 0;
10991 if (__pyx_t_35 < 0) {
10992 __pyx_t_35 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
10993 if (unlikely(__pyx_t_35 < 0)) __pyx_t_17 = 1;
10994 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_17 = 1;
10995 if (unlikely(__pyx_t_17 != -1)) {
10996 __Pyx_RaiseBufferIndexError(__pyx_t_17);
10997 __PYX_ERR(0, 451, __pyx_L1_error)
10999 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
11008 __pyx_t_36 = __pyx_v_eN;
11009 __pyx_t_37 = __pyx_v_j;
11011 if (__pyx_t_36 < 0) {
11012 __pyx_t_36 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
11013 if (unlikely(__pyx_t_36 < 0)) __pyx_t_17 = 0;
11014 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_17 = 0;
11015 if (__pyx_t_37 < 0) {
11016 __pyx_t_37 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
11017 if (unlikely(__pyx_t_37 < 0)) __pyx_t_17 = 1;
11018 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_17 = 1;
11019 if (unlikely(__pyx_t_17 != -1)) {
11020 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11021 __PYX_ERR(0, 452, __pyx_L1_error)
11023 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
11032 __pyx_t_38 = __pyx_v_eN;
11033 __pyx_t_39 = __pyx_v_j;
11035 if (__pyx_t_38 < 0) {
11036 __pyx_t_38 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
11037 if (unlikely(__pyx_t_38 < 0)) __pyx_t_17 = 0;
11038 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_17 = 0;
11039 if (__pyx_t_39 < 0) {
11040 __pyx_t_39 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
11041 if (unlikely(__pyx_t_39 < 0)) __pyx_t_17 = 1;
11042 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_17 = 1;
11043 if (unlikely(__pyx_t_17 != -1)) {
11044 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11045 __PYX_ERR(0, 454, __pyx_L1_error)
11047 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
11056 __pyx_t_40 = __pyx_v_eN;
11057 __pyx_t_41 = __pyx_v_j;
11059 if (__pyx_t_40 < 0) {
11060 __pyx_t_40 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
11061 if (unlikely(__pyx_t_40 < 0)) __pyx_t_17 = 0;
11062 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_17 = 0;
11063 if (__pyx_t_41 < 0) {
11064 __pyx_t_41 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
11065 if (unlikely(__pyx_t_41 < 0)) __pyx_t_17 = 1;
11066 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_17 = 1;
11067 if (unlikely(__pyx_t_17 != -1)) {
11068 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11069 __PYX_ERR(0, 455, __pyx_L1_error)
11071 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
11082 __pyx_t_8 = __pyx_v_nElements_global;
11083 __pyx_t_9 = __pyx_t_8;
11084 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
11085 __pyx_v_eN = __pyx_t_10;
11094 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11095 __Pyx_GOTREF(__pyx_t_5);
11096 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11097 __Pyx_GOTREF(__pyx_t_1);
11098 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11099 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11100 __Pyx_GOTREF(__pyx_t_5);
11102 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11103 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11104 if (likely(__pyx_t_4)) {
11105 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11106 __Pyx_INCREF(__pyx_t_4);
11107 __Pyx_INCREF(
function);
11108 __Pyx_DECREF_SET(__pyx_t_1,
function);
11112 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11113 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11114 __Pyx_GOTREF(__pyx_t_2);
11116 #if CYTHON_FAST_PYCALL
11117 if (PyFunction_Check(__pyx_t_1)) {
11118 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
11119 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11120 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11121 __Pyx_GOTREF(__pyx_t_2);
11122 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11125 #if CYTHON_FAST_PYCCALL
11126 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11127 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
11128 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11129 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11130 __Pyx_GOTREF(__pyx_t_2);
11131 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11135 __pyx_t_42 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 462, __pyx_L1_error)
11136 __Pyx_GOTREF(__pyx_t_42);
11137 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_t_4); __pyx_t_4 = NULL;
11138 __Pyx_GIVEREF(__pyx_t_5);
11139 PyTuple_SET_ITEM(__pyx_t_42, 0+1, __pyx_t_5);
11141 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_42, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11142 __Pyx_GOTREF(__pyx_t_2);
11143 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11147 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11148 __Pyx_GOTREF(__pyx_t_1);
11149 __pyx_t_42 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 462, __pyx_L1_error)
11150 __Pyx_GOTREF(__pyx_t_42);
11151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11152 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11153 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_42);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
11154 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11155 __pyx_v_u_eN = __pyx_t_7;
11164 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11165 __Pyx_GOTREF(__pyx_t_1);
11166 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11167 __Pyx_GOTREF(__pyx_t_2);
11168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11169 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11170 __Pyx_GOTREF(__pyx_t_1);
11172 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11173 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
11174 if (likely(__pyx_t_5)) {
11175 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11176 __Pyx_INCREF(__pyx_t_5);
11177 __Pyx_INCREF(
function);
11178 __Pyx_DECREF_SET(__pyx_t_2,
function);
11182 __pyx_t_42 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 463, __pyx_L1_error)
11183 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11184 __Pyx_GOTREF(__pyx_t_42);
11186 #if CYTHON_FAST_PYCALL
11187 if (PyFunction_Check(__pyx_t_2)) {
11188 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
11189 __pyx_t_42 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 463, __pyx_L1_error)
11190 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11191 __Pyx_GOTREF(__pyx_t_42);
11192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11195 #if CYTHON_FAST_PYCCALL
11196 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11197 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
11198 __pyx_t_42 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 463, __pyx_L1_error)
11199 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11200 __Pyx_GOTREF(__pyx_t_42);
11201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11205 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
11206 __Pyx_GOTREF(__pyx_t_4);
11207 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
11208 __Pyx_GIVEREF(__pyx_t_1);
11209 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
11211 __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 463, __pyx_L1_error)
11212 __Pyx_GOTREF(__pyx_t_42);
11213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11216 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11217 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11218 __Pyx_GOTREF(__pyx_t_2);
11219 __pyx_t_4 = PyNumber_Multiply(__pyx_t_42, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
11220 __Pyx_GOTREF(__pyx_t_4);
11221 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11222 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11223 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
11224 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11225 __pyx_v_kr_eN = __pyx_t_7;
11234 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11235 __Pyx_GOTREF(__pyx_t_4);
11236 __pyx_t_42 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 465, __pyx_L1_error)
11237 __Pyx_GOTREF(__pyx_t_42);
11238 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_dot);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11239 __Pyx_GOTREF(__pyx_t_1);
11240 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11241 __pyx_t_42 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 465, __pyx_L1_error)
11242 __Pyx_GOTREF(__pyx_t_42);
11245 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11246 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
11247 if (likely(__pyx_t_5)) {
11248 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11249 __Pyx_INCREF(__pyx_t_5);
11250 __Pyx_INCREF(
function);
11251 __Pyx_DECREF_SET(__pyx_t_1,
function);
11255 #if CYTHON_FAST_PYCALL
11256 if (PyFunction_Check(__pyx_t_1)) {
11257 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_42};
11258 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11259 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11260 __Pyx_GOTREF(__pyx_t_2);
11261 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11264 #if CYTHON_FAST_PYCCALL
11265 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11266 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_42};
11267 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11268 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11269 __Pyx_GOTREF(__pyx_t_2);
11270 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11274 __pyx_t_43 = PyTuple_New(2+__pyx_t_12);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 465, __pyx_L1_error)
11275 __Pyx_GOTREF(__pyx_t_43);
11277 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_5); __pyx_t_5 = NULL;
11279 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11280 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11281 PyTuple_SET_ITEM(__pyx_t_43, 0+__pyx_t_12, ((PyObject *)__pyx_v_gravity));
11282 __Pyx_GIVEREF(__pyx_t_42);
11283 PyTuple_SET_ITEM(__pyx_t_43, 1+__pyx_t_12, __pyx_t_42);
11285 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_43, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11286 __Pyx_GOTREF(__pyx_t_2);
11287 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11290 __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11291 __Pyx_GOTREF(__pyx_t_1);
11292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11294 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
11295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11296 __pyx_v_phi_eN = __pyx_t_7;
11305 __pyx_t_12 = __pyx_v_nElementBoundaries_element;
11306 __pyx_t_13 = __pyx_t_12;
11307 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
11308 __pyx_v_ebN = __pyx_t_14;
11317 __pyx_t_44 = __pyx_v_eN;
11318 __pyx_t_45 = __pyx_v_ebN;
11320 if (__pyx_t_44 < 0) {
11321 __pyx_t_44 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11322 if (unlikely(__pyx_t_44 < 0)) __pyx_t_17 = 0;
11323 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_17 = 0;
11324 if (__pyx_t_45 < 0) {
11325 __pyx_t_45 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11326 if (unlikely(__pyx_t_45 < 0)) __pyx_t_17 = 1;
11327 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_17 = 1;
11328 if (unlikely(__pyx_t_17 != -1)) {
11329 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11330 __PYX_ERR(0, 471, __pyx_L1_error)
11332 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
11341 __pyx_t_46 = __pyx_v_eN;
11342 __pyx_t_47 = __pyx_v_ebN;
11344 if (__pyx_t_46 < 0) {
11345 __pyx_t_46 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
11346 if (unlikely(__pyx_t_46 < 0)) __pyx_t_17 = 0;
11347 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_17 = 0;
11348 if (__pyx_t_47 < 0) {
11349 __pyx_t_47 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
11350 if (unlikely(__pyx_t_47 < 0)) __pyx_t_17 = 1;
11351 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_17 = 1;
11352 if (unlikely(__pyx_t_17 != -1)) {
11353 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11354 __PYX_ERR(0, 472, __pyx_L1_error)
11356 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
11365 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
11375 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11376 __Pyx_GOTREF(__pyx_t_2);
11377 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
11378 __Pyx_GOTREF(__pyx_t_4);
11379 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11380 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11381 __Pyx_GOTREF(__pyx_t_2);
11383 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11384 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_4);
11385 if (likely(__pyx_t_43)) {
11386 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11387 __Pyx_INCREF(__pyx_t_43);
11388 __Pyx_INCREF(
function);
11389 __Pyx_DECREF_SET(__pyx_t_4,
function);
11393 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11394 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11395 __Pyx_GOTREF(__pyx_t_1);
11397 #if CYTHON_FAST_PYCALL
11398 if (PyFunction_Check(__pyx_t_4)) {
11399 PyObject *__pyx_temp[2] = {__pyx_t_43, __pyx_t_2};
11400 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11401 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11402 __Pyx_GOTREF(__pyx_t_1);
11403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11406 #if CYTHON_FAST_PYCCALL
11407 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11408 PyObject *__pyx_temp[2] = {__pyx_t_43, __pyx_t_2};
11409 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11410 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11411 __Pyx_GOTREF(__pyx_t_1);
11412 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11416 __pyx_t_42 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 474, __pyx_L1_error)
11417 __Pyx_GOTREF(__pyx_t_42);
11418 __Pyx_GIVEREF(__pyx_t_43); PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_t_43); __pyx_t_43 = NULL;
11419 __Pyx_GIVEREF(__pyx_t_2);
11420 PyTuple_SET_ITEM(__pyx_t_42, 0+1, __pyx_t_2);
11422 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_42, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11423 __Pyx_GOTREF(__pyx_t_1);
11424 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11427 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11428 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
11429 __Pyx_GOTREF(__pyx_t_4);
11430 __pyx_t_42 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 474, __pyx_L1_error)
11431 __Pyx_GOTREF(__pyx_t_42);
11432 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11433 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11434 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_42);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error)
11435 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11436 __pyx_v_u_neig = __pyx_t_7;
11445 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11446 __Pyx_GOTREF(__pyx_t_4);
11447 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11448 __Pyx_GOTREF(__pyx_t_1);
11449 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11450 __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11451 __Pyx_GOTREF(__pyx_t_4);
11453 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11454 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
11455 if (likely(__pyx_t_2)) {
11456 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11457 __Pyx_INCREF(__pyx_t_2);
11458 __Pyx_INCREF(
function);
11459 __Pyx_DECREF_SET(__pyx_t_1,
function);
11463 __pyx_t_42 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 475, __pyx_L1_error)
11464 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11465 __Pyx_GOTREF(__pyx_t_42);
11467 #if CYTHON_FAST_PYCALL
11468 if (PyFunction_Check(__pyx_t_1)) {
11469 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
11470 __pyx_t_42 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 475, __pyx_L1_error)
11471 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11472 __Pyx_GOTREF(__pyx_t_42);
11473 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11476 #if CYTHON_FAST_PYCCALL
11477 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11478 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
11479 __pyx_t_42 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 475, __pyx_L1_error)
11480 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11481 __Pyx_GOTREF(__pyx_t_42);
11482 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11486 __pyx_t_43 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 475, __pyx_L1_error)
11487 __Pyx_GOTREF(__pyx_t_43);
11488 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_2); __pyx_t_2 = NULL;
11489 __Pyx_GIVEREF(__pyx_t_4);
11490 PyTuple_SET_ITEM(__pyx_t_43, 0+1, __pyx_t_4);
11492 __pyx_t_42 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_43, NULL);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 475, __pyx_L1_error)
11493 __Pyx_GOTREF(__pyx_t_42);
11494 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11498 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11499 __Pyx_GOTREF(__pyx_t_1);
11500 __pyx_t_43 = PyNumber_Multiply(__pyx_t_42, __pyx_t_1);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 475, __pyx_L1_error)
11501 __Pyx_GOTREF(__pyx_t_43);
11502 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11503 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11504 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_43);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
11505 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11506 __pyx_v_kr_neig = __pyx_t_7;
11515 __pyx_t_43 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 477, __pyx_L1_error)
11516 __Pyx_GOTREF(__pyx_t_43);
11517 __pyx_t_42 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 477, __pyx_L1_error)
11518 __Pyx_GOTREF(__pyx_t_42);
11519 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_42, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11520 __Pyx_GOTREF(__pyx_t_4);
11521 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11522 __pyx_t_42 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 477, __pyx_L1_error)
11523 __Pyx_GOTREF(__pyx_t_42);
11526 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11527 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
11528 if (likely(__pyx_t_2)) {
11529 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11530 __Pyx_INCREF(__pyx_t_2);
11531 __Pyx_INCREF(
function);
11532 __Pyx_DECREF_SET(__pyx_t_4,
function);
11536 #if CYTHON_FAST_PYCALL
11537 if (PyFunction_Check(__pyx_t_4)) {
11538 PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_gravity), __pyx_t_42};
11539 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11540 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11541 __Pyx_GOTREF(__pyx_t_1);
11542 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11545 #if CYTHON_FAST_PYCCALL
11546 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11547 PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_gravity), __pyx_t_42};
11548 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11549 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11550 __Pyx_GOTREF(__pyx_t_1);
11551 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
11555 __pyx_t_5 = PyTuple_New(2+__pyx_t_17);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
11556 __Pyx_GOTREF(__pyx_t_5);
11558 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
11560 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11561 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11562 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_17, ((PyObject *)__pyx_v_gravity));
11563 __Pyx_GIVEREF(__pyx_t_42);
11564 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_17, __pyx_t_42);
11566 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11567 __Pyx_GOTREF(__pyx_t_1);
11568 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11570 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11571 __pyx_t_4 = PyNumber_Subtract(__pyx_t_43, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11572 __Pyx_GOTREF(__pyx_t_4);
11573 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11575 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
11576 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11577 __pyx_v_phi_neig = __pyx_t_7;
11586 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
11596 __pyx_t_48 = __pyx_v_eN;
11597 __pyx_t_49 = __pyx_v_ebN;
11599 if (__pyx_t_48 < 0) {
11600 __pyx_t_48 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11601 if (unlikely(__pyx_t_48 < 0)) __pyx_t_17 = 0;
11602 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_17 = 0;
11603 if (__pyx_t_49 < 0) {
11604 __pyx_t_49 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11605 if (unlikely(__pyx_t_49 < 0)) __pyx_t_17 = 1;
11606 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_17 = 1;
11607 if (unlikely(__pyx_t_17 != -1)) {
11608 __Pyx_RaiseBufferIndexError(__pyx_t_17);
11609 __PYX_ERR(0, 480, __pyx_L1_error)
11611 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
11642 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11645 __Pyx_XDECREF(__pyx_t_1);
11646 __Pyx_XDECREF(__pyx_t_2);
11647 __Pyx_XDECREF(__pyx_t_4);
11648 __Pyx_XDECREF(__pyx_t_5);
11649 __Pyx_XDECREF(__pyx_t_42);
11650 __Pyx_XDECREF(__pyx_t_43);
11651 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11652 __Pyx_PyThreadState_declare
11653 __Pyx_PyThreadState_assign
11654 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11656 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11657 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11658 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11659 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11660 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11661 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11662 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11663 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11664 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11665 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11666 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11667 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11668 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11669 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11670 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11671 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11672 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11673 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11674 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
11678 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11679 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11680 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11681 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11682 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11683 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11684 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11685 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11686 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11687 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11688 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11689 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11690 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11691 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11692 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11693 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11694 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11695 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11697 __Pyx_XDECREF(__pyx_v_q);
11698 __Pyx_XGIVEREF(__pyx_r);
11699 __Pyx_RefNannyFinishContext();
11712 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11713 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11714 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
11715 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11716 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11717 PyArrayObject *__pyx_v_rowptr = 0;
11718 PyArrayObject *__pyx_v_colind = 0;
11719 int __pyx_v_nSpace;
11720 int __pyx_v_nElements_global;
11721 int __pyx_v_nElementBoundaries_element;
11722 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11723 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11724 int __pyx_v_nDOF_test_element;
11725 PyArrayObject *__pyx_v_q_u = 0;
11726 PyArrayObject *__pyx_v_q_grad_u = 0;
11727 PyArrayObject *__pyx_v_q_grad_w = 0;
11728 PyArrayObject *__pyx_v_q_detJ = 0;
11729 PyArrayObject *__pyx_v_q_m = 0;
11730 PyArrayObject *__pyx_v_q_mt = 0;
11731 PyArrayObject *__pyx_v_q_r = 0;
11732 PyArrayObject *__pyx_v_q_kr = 0;
11733 PyArrayObject *__pyx_v_q_kr_up = 0;
11734 PyArrayObject *__pyx_v_q_flin = 0;
11735 PyArrayObject *__pyx_v_q_alin = 0;
11736 PyArrayObject *__pyx_v_elementResidual = 0;
11737 PyObject *__pyx_r = 0;
11738 __Pyx_RefNannyDeclarations
11739 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
11741 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
11742 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11743 if (unlikely(__pyx_kwds)) {
11744 Py_ssize_t kw_args;
11745 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11746 switch (pos_args) {
11747 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11748 CYTHON_FALLTHROUGH;
11749 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11750 CYTHON_FALLTHROUGH;
11751 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11752 CYTHON_FALLTHROUGH;
11753 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11754 CYTHON_FALLTHROUGH;
11755 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11756 CYTHON_FALLTHROUGH;
11757 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11758 CYTHON_FALLTHROUGH;
11759 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11760 CYTHON_FALLTHROUGH;
11761 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11762 CYTHON_FALLTHROUGH;
11763 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11764 CYTHON_FALLTHROUGH;
11765 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11766 CYTHON_FALLTHROUGH;
11767 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11768 CYTHON_FALLTHROUGH;
11769 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11770 CYTHON_FALLTHROUGH;
11771 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11772 CYTHON_FALLTHROUGH;
11773 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11774 CYTHON_FALLTHROUGH;
11775 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11776 CYTHON_FALLTHROUGH;
11777 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11778 CYTHON_FALLTHROUGH;
11779 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11780 CYTHON_FALLTHROUGH;
11781 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11782 CYTHON_FALLTHROUGH;
11783 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11784 CYTHON_FALLTHROUGH;
11785 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11786 CYTHON_FALLTHROUGH;
11787 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11788 CYTHON_FALLTHROUGH;
11790 default:
goto __pyx_L5_argtuple_error;
11792 kw_args = PyDict_Size(__pyx_kwds);
11793 switch (pos_args) {
11795 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
11796 else goto __pyx_L5_argtuple_error;
11797 CYTHON_FALLTHROUGH;
11799 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11801 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); __PYX_ERR(0, 486, __pyx_L3_error)
11803 CYTHON_FALLTHROUGH;
11805 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11807 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); __PYX_ERR(0, 486, __pyx_L3_error)
11809 CYTHON_FALLTHROUGH;
11811 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11813 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); __PYX_ERR(0, 486, __pyx_L3_error)
11815 CYTHON_FALLTHROUGH;
11817 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
11819 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); __PYX_ERR(0, 486, __pyx_L3_error)
11821 CYTHON_FALLTHROUGH;
11823 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
11825 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); __PYX_ERR(0, 486, __pyx_L3_error)
11827 CYTHON_FALLTHROUGH;
11829 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
11831 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); __PYX_ERR(0, 486, __pyx_L3_error)
11833 CYTHON_FALLTHROUGH;
11835 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
11837 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); __PYX_ERR(0, 486, __pyx_L3_error)
11839 CYTHON_FALLTHROUGH;
11841 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
11843 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); __PYX_ERR(0, 486, __pyx_L3_error)
11845 CYTHON_FALLTHROUGH;
11847 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
11849 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); __PYX_ERR(0, 486, __pyx_L3_error)
11851 CYTHON_FALLTHROUGH;
11853 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
11855 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); __PYX_ERR(0, 486, __pyx_L3_error)
11857 CYTHON_FALLTHROUGH;
11859 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
11861 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); __PYX_ERR(0, 486, __pyx_L3_error)
11863 CYTHON_FALLTHROUGH;
11865 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
11867 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); __PYX_ERR(0, 486, __pyx_L3_error)
11869 CYTHON_FALLTHROUGH;
11871 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
11873 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); __PYX_ERR(0, 486, __pyx_L3_error)
11875 CYTHON_FALLTHROUGH;
11877 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
11879 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); __PYX_ERR(0, 486, __pyx_L3_error)
11881 CYTHON_FALLTHROUGH;
11883 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
11885 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); __PYX_ERR(0, 486, __pyx_L3_error)
11887 CYTHON_FALLTHROUGH;
11889 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
11891 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); __PYX_ERR(0, 486, __pyx_L3_error)
11893 CYTHON_FALLTHROUGH;
11895 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
11897 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); __PYX_ERR(0, 486, __pyx_L3_error)
11899 CYTHON_FALLTHROUGH;
11901 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
11903 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); __PYX_ERR(0, 486, __pyx_L3_error)
11905 CYTHON_FALLTHROUGH;
11907 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
11909 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); __PYX_ERR(0, 486, __pyx_L3_error)
11911 CYTHON_FALLTHROUGH;
11913 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
11915 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); __PYX_ERR(0, 486, __pyx_L3_error)
11918 if (unlikely(kw_args > 0)) {
11919 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
11921 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
11922 goto __pyx_L5_argtuple_error;
11924 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11925 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11926 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11927 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11928 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11929 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11930 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11931 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11932 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11933 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11934 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11935 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11936 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11937 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11938 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11939 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11940 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11941 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11942 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11943 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11944 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11946 __pyx_v_gravity = ((PyArrayObject *)values[0]);
11947 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
11948 __pyx_v_colind = ((PyArrayObject *)values[2]);
11949 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
11950 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
11951 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
11952 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
11953 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
11954 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
11955 __pyx_v_q_u = ((PyArrayObject *)values[9]);
11956 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
11957 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
11958 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
11959 __pyx_v_q_m = ((PyArrayObject *)values[13]);
11960 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
11961 __pyx_v_q_r = ((PyArrayObject *)values[15]);
11962 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
11963 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
11964 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
11965 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
11966 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
11968 goto __pyx_L4_argument_unpacking_done;
11969 __pyx_L5_argtuple_error:;
11970 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
11972 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
11973 __Pyx_RefNannyFinishContext();
11975 __pyx_L4_argument_unpacking_done:;
11976 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
11977 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
11978 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
11979 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 493, __pyx_L1_error)
11980 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
11981 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 497, __pyx_L1_error)
11982 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
11983 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
11984 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 501, __pyx_L1_error)
11985 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
11986 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
11987 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
11988 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
11989 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
11990 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 509, __pyx_L1_error)
11991 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
11992 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) __PYX_ERR(0, 512, __pyx_L1_error)
11993 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
12000 __Pyx_RefNannyFinishContext();
12004 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
12005 CYTHON_UNUSED
int __pyx_v_upwindFlag;
12006 PyObject *__pyx_v_q = NULL;
12013 PyArrayObject *__pyx_v_a_up = 0;
12014 PyArrayObject *__pyx_v_f_up = 0;
12015 double __pyx_v_nAvgWeight;
12016 double __pyx_v_weight;
12017 double __pyx_v_volFactor;
12018 double __pyx_v_volume;
12019 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
12020 __Pyx_Buffer __pyx_pybuffer_a_up;
12021 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
12022 __Pyx_Buffer __pyx_pybuffer_colind;
12023 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
12024 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
12025 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
12026 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
12027 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
12028 __Pyx_Buffer __pyx_pybuffer_elementResidual;
12029 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
12030 __Pyx_Buffer __pyx_pybuffer_f_up;
12031 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
12032 __Pyx_Buffer __pyx_pybuffer_gravity;
12033 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
12034 __Pyx_Buffer __pyx_pybuffer_q_alin;
12035 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
12036 __Pyx_Buffer __pyx_pybuffer_q_detJ;
12037 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
12038 __Pyx_Buffer __pyx_pybuffer_q_flin;
12039 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
12040 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
12041 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
12042 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
12043 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
12044 __Pyx_Buffer __pyx_pybuffer_q_kr;
12045 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
12046 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
12047 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
12048 __Pyx_Buffer __pyx_pybuffer_q_m;
12049 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
12050 __Pyx_Buffer __pyx_pybuffer_q_mt;
12051 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
12052 __Pyx_Buffer __pyx_pybuffer_q_r;
12053 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
12054 __Pyx_Buffer __pyx_pybuffer_q_u;
12055 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
12056 __Pyx_Buffer __pyx_pybuffer_rowptr;
12057 PyObject *__pyx_r = NULL;
12058 __Pyx_RefNannyDeclarations
12059 PyObject *__pyx_t_1 = NULL;
12060 PyObject *__pyx_t_2 = NULL;
12061 Py_ssize_t __pyx_t_3;
12062 PyObject *__pyx_t_4 = NULL;
12063 PyObject *__pyx_t_5 = NULL;
12065 Py_ssize_t __pyx_t_7;
12067 PyObject *__pyx_t_9 = NULL;
12068 PyArrayObject *__pyx_t_10 = NULL;
12069 PyArrayObject *__pyx_t_11 = NULL;
12073 Py_ssize_t __pyx_t_15;
12074 Py_ssize_t __pyx_t_16;
12078 Py_ssize_t __pyx_t_20;
12079 Py_ssize_t __pyx_t_21;
12081 Py_ssize_t __pyx_t_23;
12082 Py_ssize_t __pyx_t_24;
12083 Py_ssize_t __pyx_t_25;
12084 Py_ssize_t __pyx_t_26;
12085 Py_ssize_t __pyx_t_27;
12086 Py_ssize_t __pyx_t_28;
12092 Py_ssize_t __pyx_t_34;
12093 Py_ssize_t __pyx_t_35;
12094 Py_ssize_t __pyx_t_36;
12096 Py_ssize_t __pyx_t_38;
12097 Py_ssize_t __pyx_t_39;
12098 Py_ssize_t __pyx_t_40;
12099 Py_ssize_t __pyx_t_41;
12100 Py_ssize_t __pyx_t_42;
12101 Py_ssize_t __pyx_t_43;
12102 Py_ssize_t __pyx_t_44;
12103 Py_ssize_t __pyx_t_45;
12104 Py_ssize_t __pyx_t_46;
12105 Py_ssize_t __pyx_t_47;
12106 Py_ssize_t __pyx_t_48;
12107 Py_ssize_t __pyx_t_49;
12108 Py_ssize_t __pyx_t_50;
12109 Py_ssize_t __pyx_t_51;
12110 Py_ssize_t __pyx_t_52;
12111 Py_ssize_t __pyx_t_53;
12112 Py_ssize_t __pyx_t_54;
12113 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_55;
12114 Py_ssize_t __pyx_t_56;
12115 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_57;
12116 Py_ssize_t __pyx_t_58;
12118 Py_ssize_t __pyx_t_60;
12119 Py_ssize_t __pyx_t_61;
12120 Py_ssize_t __pyx_t_62;
12121 Py_ssize_t __pyx_t_63;
12122 Py_ssize_t __pyx_t_64;
12123 Py_ssize_t __pyx_t_65;
12124 Py_ssize_t __pyx_t_66;
12125 Py_ssize_t __pyx_t_67;
12126 Py_ssize_t __pyx_t_68;
12127 Py_ssize_t __pyx_t_69;
12128 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
12129 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
12130 __pyx_pybuffer_a_up.refcount = 0;
12131 __pyx_pybuffernd_a_up.data = NULL;
12132 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
12133 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
12134 __pyx_pybuffer_f_up.refcount = 0;
12135 __pyx_pybuffernd_f_up.data = NULL;
12136 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
12137 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
12138 __pyx_pybuffer_gravity.refcount = 0;
12139 __pyx_pybuffernd_gravity.data = NULL;
12140 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
12141 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
12142 __pyx_pybuffer_rowptr.refcount = 0;
12143 __pyx_pybuffernd_rowptr.data = NULL;
12144 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
12145 __pyx_pybuffer_colind.pybuffer.buf = NULL;
12146 __pyx_pybuffer_colind.refcount = 0;
12147 __pyx_pybuffernd_colind.data = NULL;
12148 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
12149 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
12150 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
12151 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
12152 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
12153 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
12154 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
12155 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
12156 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
12157 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
12158 __pyx_pybuffer_q_u.refcount = 0;
12159 __pyx_pybuffernd_q_u.data = NULL;
12160 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
12161 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
12162 __pyx_pybuffer_q_grad_u.refcount = 0;
12163 __pyx_pybuffernd_q_grad_u.data = NULL;
12164 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
12165 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
12166 __pyx_pybuffer_q_grad_w.refcount = 0;
12167 __pyx_pybuffernd_q_grad_w.data = NULL;
12168 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
12169 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
12170 __pyx_pybuffer_q_detJ.refcount = 0;
12171 __pyx_pybuffernd_q_detJ.data = NULL;
12172 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
12173 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
12174 __pyx_pybuffer_q_m.refcount = 0;
12175 __pyx_pybuffernd_q_m.data = NULL;
12176 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
12177 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
12178 __pyx_pybuffer_q_mt.refcount = 0;
12179 __pyx_pybuffernd_q_mt.data = NULL;
12180 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
12181 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
12182 __pyx_pybuffer_q_r.refcount = 0;
12183 __pyx_pybuffernd_q_r.data = NULL;
12184 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
12185 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
12186 __pyx_pybuffer_q_kr.refcount = 0;
12187 __pyx_pybuffernd_q_kr.data = NULL;
12188 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
12189 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
12190 __pyx_pybuffer_q_kr_up.refcount = 0;
12191 __pyx_pybuffernd_q_kr_up.data = NULL;
12192 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
12193 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
12194 __pyx_pybuffer_q_flin.refcount = 0;
12195 __pyx_pybuffernd_q_flin.data = NULL;
12196 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
12197 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
12198 __pyx_pybuffer_q_alin.refcount = 0;
12199 __pyx_pybuffernd_q_alin.data = NULL;
12200 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
12201 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
12202 __pyx_pybuffer_elementResidual.refcount = 0;
12203 __pyx_pybuffernd_elementResidual.data = NULL;
12204 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
12206 __Pyx_BufFmt_StackElem __pyx_stack[1];
12207 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12209 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
12211 __Pyx_BufFmt_StackElem __pyx_stack[1];
12212 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12214 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
12216 __Pyx_BufFmt_StackElem __pyx_stack[1];
12217 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12219 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
12221 __Pyx_BufFmt_StackElem __pyx_stack[1];
12222 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12224 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
12226 __Pyx_BufFmt_StackElem __pyx_stack[1];
12227 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12229 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
12231 __Pyx_BufFmt_StackElem __pyx_stack[1];
12232 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12234 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
12236 __Pyx_BufFmt_StackElem __pyx_stack[1];
12237 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12239 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
12241 __Pyx_BufFmt_StackElem __pyx_stack[1];
12242 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12244 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
12246 __Pyx_BufFmt_StackElem __pyx_stack[1];
12247 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12249 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
12251 __Pyx_BufFmt_StackElem __pyx_stack[1];
12252 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12254 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
12256 __Pyx_BufFmt_StackElem __pyx_stack[1];
12257 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12259 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
12261 __Pyx_BufFmt_StackElem __pyx_stack[1];
12262 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12264 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
12266 __Pyx_BufFmt_StackElem __pyx_stack[1];
12267 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12269 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
12271 __Pyx_BufFmt_StackElem __pyx_stack[1];
12272 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12274 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
12276 __Pyx_BufFmt_StackElem __pyx_stack[1];
12277 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12279 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
12281 __Pyx_BufFmt_StackElem __pyx_stack[1];
12282 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12284 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
12286 __Pyx_BufFmt_StackElem __pyx_stack[1];
12287 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12289 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
12298 __pyx_v_upwindFlag = 1;
12307 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12308 __Pyx_GOTREF(__pyx_t_1);
12309 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
12310 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
12311 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
12312 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
12313 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
12314 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
12315 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
12316 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
12317 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
12318 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
12319 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
12320 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
12321 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
12322 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
12323 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
12324 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12327 if (__pyx_t_3 >= 5)
break;
12328 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12329 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
12331 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12332 __Pyx_GOTREF(__pyx_t_1);
12334 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
12344 #ifndef CYTHON_WITHOUT_ASSERTIONS
12345 if (unlikely(!Py_OptimizeFlag)) {
12346 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12347 __Pyx_GOTREF(__pyx_t_1);
12348 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
12349 __Pyx_GOTREF(__pyx_t_4);
12350 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12351 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12352 __Pyx_GOTREF(__pyx_t_1);
12353 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
12354 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12355 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12356 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
12357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12358 if (unlikely(!__pyx_t_6)) {
12359 PyErr_SetNone(PyExc_AssertionError);
12360 __PYX_ERR(0, 530, __pyx_L1_error)
12373 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12382 #ifndef CYTHON_WITHOUT_ASSERTIONS
12383 if (unlikely(!Py_OptimizeFlag)) {
12384 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
12385 PyErr_SetNone(PyExc_AssertionError);
12386 __PYX_ERR(0, 531, __pyx_L1_error)
12398 __pyx_t_7 = __pyx_v_nSpace;
12400 if (__pyx_t_7 < 0) {
12401 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12402 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
12403 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
12404 if (unlikely(__pyx_t_8 != -1)) {
12405 __Pyx_RaiseBufferIndexError(__pyx_t_8);
12406 __PYX_ERR(0, 532, __pyx_L1_error)
12408 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12417 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12418 __Pyx_GOTREF(__pyx_t_5);
12419 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
12420 __Pyx_GOTREF(__pyx_t_1);
12421 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12422 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12423 __Pyx_GOTREF(__pyx_t_5);
12426 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12427 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
12428 if (likely(__pyx_t_4)) {
12429 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12430 __Pyx_INCREF(__pyx_t_4);
12431 __Pyx_INCREF(
function);
12432 __Pyx_DECREF_SET(__pyx_t_1,
function);
12436 #if CYTHON_FAST_PYCALL
12437 if (PyFunction_Check(__pyx_t_1)) {
12438 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12439 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12440 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12441 __Pyx_GOTREF(__pyx_t_2);
12442 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12445 #if CYTHON_FAST_PYCCALL
12446 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
12447 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12448 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12449 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12450 __Pyx_GOTREF(__pyx_t_2);
12451 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12455 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
12456 __Pyx_GOTREF(__pyx_t_9);
12458 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
12460 __Pyx_GIVEREF(__pyx_t_5);
12461 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
12462 __Pyx_INCREF(__pyx_n_s_d);
12463 __Pyx_GIVEREF(__pyx_n_s_d);
12464 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
12466 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12467 __Pyx_GOTREF(__pyx_t_2);
12468 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12470 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12471 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
12472 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
12474 __Pyx_BufFmt_StackElem __pyx_stack[1];
12475 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12476 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
12477 __PYX_ERR(0, 536, __pyx_L1_error)
12478 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
12482 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
12492 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12493 __Pyx_GOTREF(__pyx_t_1);
12494 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
12495 __Pyx_GOTREF(__pyx_t_9);
12496 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12497 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12498 __Pyx_GOTREF(__pyx_t_1);
12501 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
12502 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
12503 if (likely(__pyx_t_5)) {
12504 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12505 __Pyx_INCREF(__pyx_t_5);
12506 __Pyx_INCREF(
function);
12507 __Pyx_DECREF_SET(__pyx_t_9,
function);
12511 #if CYTHON_FAST_PYCALL
12512 if (PyFunction_Check(__pyx_t_9)) {
12513 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12514 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12515 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12516 __Pyx_GOTREF(__pyx_t_2);
12517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12520 #if CYTHON_FAST_PYCCALL
12521 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12522 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12523 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12524 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12525 __Pyx_GOTREF(__pyx_t_2);
12526 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12530 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
12531 __Pyx_GOTREF(__pyx_t_4);
12533 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12535 __Pyx_GIVEREF(__pyx_t_1);
12536 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
12537 __Pyx_INCREF(__pyx_n_s_d);
12538 __Pyx_GIVEREF(__pyx_n_s_d);
12539 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
12541 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12542 __Pyx_GOTREF(__pyx_t_2);
12543 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12545 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12546 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
12547 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12549 __Pyx_BufFmt_StackElem __pyx_stack[1];
12550 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12551 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12552 __PYX_ERR(0, 537, __pyx_L1_error)
12553 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12557 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12567 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12568 if (unlikely(__pyx_t_12 == 0)) {
12569 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12570 __PYX_ERR(0, 539, __pyx_L1_error)
12572 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12581 __pyx_v_weight = 1.0;
12582 __pyx_v_volFactor = 1.0;
12591 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12601 __pyx_v_volFactor = 0.5;
12619 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12629 __pyx_v_volFactor = (1.0 / 6.0);
12647 __pyx_t_8 = __pyx_v_nElements_global;
12648 __pyx_t_13 = __pyx_t_8;
12649 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12650 __pyx_v_eN = __pyx_t_14;
12659 __pyx_t_15 = __pyx_v_eN;
12662 if (__pyx_t_15 < 0) {
12663 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12664 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
12665 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_17 = 0;
12666 if (__pyx_t_16 < 0) {
12667 __pyx_t_16 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12668 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
12669 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_17 = 1;
12670 if (unlikely(__pyx_t_17 != -1)) {
12671 __Pyx_RaiseBufferIndexError(__pyx_t_17);
12672 __PYX_ERR(0, 547, __pyx_L1_error)
12674 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12683 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12692 __pyx_t_17 = __pyx_v_nDOF_test_element;
12693 __pyx_t_18 = __pyx_t_17;
12694 for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
12695 __pyx_v_i = __pyx_t_19;
12704 __pyx_t_20 = __pyx_v_eN;
12705 __pyx_t_21 = __pyx_v_i;
12707 if (__pyx_t_20 < 0) {
12708 __pyx_t_20 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
12709 if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
12710 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_22 = 0;
12711 if (__pyx_t_21 < 0) {
12712 __pyx_t_21 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
12713 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 1;
12714 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_22 = 1;
12715 if (unlikely(__pyx_t_22 != -1)) {
12716 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12717 __PYX_ERR(0, 553, __pyx_L1_error)
12719 __pyx_t_23 = __pyx_v_eN;
12720 __pyx_t_24 = __pyx_v_i;
12722 if (__pyx_t_23 < 0) {
12723 __pyx_t_23 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12724 if (unlikely(__pyx_t_23 < 0)) __pyx_t_22 = 0;
12725 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_22 = 0;
12726 if (__pyx_t_24 < 0) {
12727 __pyx_t_24 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12728 if (unlikely(__pyx_t_24 < 0)) __pyx_t_22 = 1;
12729 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_22 = 1;
12730 if (unlikely(__pyx_t_22 != -1)) {
12731 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12732 __PYX_ERR(0, 553, __pyx_L1_error)
12734 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
12743 __pyx_t_25 = __pyx_v_eN;
12744 __pyx_t_26 = __pyx_v_i;
12746 if (__pyx_t_25 < 0) {
12747 __pyx_t_25 += __pyx_pybuffernd_q_r.diminfo[0].shape;
12748 if (unlikely(__pyx_t_25 < 0)) __pyx_t_22 = 0;
12749 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_22 = 0;
12750 if (__pyx_t_26 < 0) {
12751 __pyx_t_26 += __pyx_pybuffernd_q_r.diminfo[1].shape;
12752 if (unlikely(__pyx_t_26 < 0)) __pyx_t_22 = 1;
12753 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_22 = 1;
12754 if (unlikely(__pyx_t_22 != -1)) {
12755 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12756 __PYX_ERR(0, 555, __pyx_L1_error)
12758 __pyx_t_27 = __pyx_v_eN;
12759 __pyx_t_28 = __pyx_v_i;
12761 if (__pyx_t_27 < 0) {
12762 __pyx_t_27 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12763 if (unlikely(__pyx_t_27 < 0)) __pyx_t_22 = 0;
12764 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_22 = 0;
12765 if (__pyx_t_28 < 0) {
12766 __pyx_t_28 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12767 if (unlikely(__pyx_t_28 < 0)) __pyx_t_22 = 1;
12768 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_22 = 1;
12769 if (unlikely(__pyx_t_22 != -1)) {
12770 __Pyx_RaiseBufferIndexError(__pyx_t_22);
12771 __PYX_ERR(0, 555, __pyx_L1_error)
12773 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_q_r.diminfo[1].strides)));
12782 __pyx_t_22 = __pyx_v_nElementBoundaries_element;
12783 __pyx_t_29 = __pyx_t_22;
12784 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
12785 __pyx_v_ebN = __pyx_t_30;
12794 __pyx_t_31 = __pyx_v_nnz;
12795 __pyx_t_32 = __pyx_t_31;
12796 for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
12797 __pyx_v_ii = __pyx_t_33;
12806 __pyx_t_34 = __pyx_v_eN;
12807 __pyx_t_35 = __pyx_v_ebN;
12808 __pyx_t_36 = __pyx_v_ii;
12810 if (__pyx_t_34 < 0) {
12811 __pyx_t_34 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
12812 if (unlikely(__pyx_t_34 < 0)) __pyx_t_37 = 0;
12813 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_37 = 0;
12814 if (__pyx_t_35 < 0) {
12815 __pyx_t_35 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
12816 if (unlikely(__pyx_t_35 < 0)) __pyx_t_37 = 1;
12817 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_37 = 1;
12818 if (__pyx_t_36 < 0) {
12819 __pyx_t_36 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
12820 if (unlikely(__pyx_t_36 < 0)) __pyx_t_37 = 2;
12821 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_37 = 2;
12822 if (unlikely(__pyx_t_37 != -1)) {
12823 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12824 __PYX_ERR(0, 561, __pyx_L1_error)
12826 __pyx_t_38 = __pyx_v_eN;
12827 __pyx_t_39 = __pyx_v_ebN;
12829 if (__pyx_t_38 < 0) {
12830 __pyx_t_38 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12831 if (unlikely(__pyx_t_38 < 0)) __pyx_t_37 = 0;
12832 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_37 = 0;
12833 if (__pyx_t_39 < 0) {
12834 __pyx_t_39 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12835 if (unlikely(__pyx_t_39 < 0)) __pyx_t_37 = 1;
12836 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_37 = 1;
12837 if (unlikely(__pyx_t_37 != -1)) {
12838 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12839 __PYX_ERR(0, 561, __pyx_L1_error)
12841 __pyx_t_40 = __pyx_v_ii;
12843 if (__pyx_t_40 < 0) {
12844 __pyx_t_40 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12845 if (unlikely(__pyx_t_40 < 0)) __pyx_t_37 = 0;
12846 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_37 = 0;
12847 if (unlikely(__pyx_t_37 != -1)) {
12848 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12849 __PYX_ERR(0, 561, __pyx_L1_error)
12851 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12861 __pyx_t_31 = __pyx_v_nSpace;
12862 __pyx_t_32 = __pyx_t_31;
12863 for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
12864 __pyx_v_I = __pyx_t_33;
12873 __pyx_t_41 = __pyx_v_eN;
12874 __pyx_t_42 = __pyx_v_ebN;
12875 __pyx_t_43 = __pyx_v_I;
12877 if (__pyx_t_41 < 0) {
12878 __pyx_t_41 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
12879 if (unlikely(__pyx_t_41 < 0)) __pyx_t_37 = 0;
12880 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_37 = 0;
12881 if (__pyx_t_42 < 0) {
12882 __pyx_t_42 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
12883 if (unlikely(__pyx_t_42 < 0)) __pyx_t_37 = 1;
12884 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_37 = 1;
12885 if (__pyx_t_43 < 0) {
12886 __pyx_t_43 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
12887 if (unlikely(__pyx_t_43 < 0)) __pyx_t_37 = 2;
12888 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_37 = 2;
12889 if (unlikely(__pyx_t_37 != -1)) {
12890 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12891 __PYX_ERR(0, 563, __pyx_L1_error)
12893 __pyx_t_44 = __pyx_v_eN;
12894 __pyx_t_45 = __pyx_v_ebN;
12896 if (__pyx_t_44 < 0) {
12897 __pyx_t_44 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12898 if (unlikely(__pyx_t_44 < 0)) __pyx_t_37 = 0;
12899 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_37 = 0;
12900 if (__pyx_t_45 < 0) {
12901 __pyx_t_45 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12902 if (unlikely(__pyx_t_45 < 0)) __pyx_t_37 = 1;
12903 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_37 = 1;
12904 if (unlikely(__pyx_t_37 != -1)) {
12905 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12906 __PYX_ERR(0, 563, __pyx_L1_error)
12908 __pyx_t_46 = __pyx_v_I;
12910 if (__pyx_t_46 < 0) {
12911 __pyx_t_46 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12912 if (unlikely(__pyx_t_46 < 0)) __pyx_t_37 = 0;
12913 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_37 = 0;
12914 if (unlikely(__pyx_t_37 != -1)) {
12915 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12916 __PYX_ERR(0, 563, __pyx_L1_error)
12918 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12928 __pyx_t_31 = __pyx_v_nSpace;
12929 __pyx_t_32 = __pyx_t_31;
12930 for (__pyx_t_33 = 0; __pyx_t_33 < __pyx_t_32; __pyx_t_33+=1) {
12931 __pyx_v_I = __pyx_t_33;
12940 __pyx_t_47 = __pyx_v_I;
12942 if (__pyx_t_47 < 0) {
12943 __pyx_t_47 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12944 if (unlikely(__pyx_t_47 < 0)) __pyx_t_37 = 0;
12945 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_37 = 0;
12946 if (unlikely(__pyx_t_37 != -1)) {
12947 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12948 __PYX_ERR(0, 567, __pyx_L1_error)
12950 __pyx_t_48 = __pyx_v_eN;
12951 __pyx_t_49 = __pyx_v_ebN;
12952 __pyx_t_50 = __pyx_v_i;
12953 __pyx_t_51 = __pyx_v_I;
12955 if (__pyx_t_48 < 0) {
12956 __pyx_t_48 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12957 if (unlikely(__pyx_t_48 < 0)) __pyx_t_37 = 0;
12958 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_37 = 0;
12959 if (__pyx_t_49 < 0) {
12960 __pyx_t_49 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12961 if (unlikely(__pyx_t_49 < 0)) __pyx_t_37 = 1;
12962 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_37 = 1;
12963 if (__pyx_t_50 < 0) {
12964 __pyx_t_50 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12965 if (unlikely(__pyx_t_50 < 0)) __pyx_t_37 = 2;
12966 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_37 = 2;
12967 if (__pyx_t_51 < 0) {
12968 __pyx_t_51 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12969 if (unlikely(__pyx_t_51 < 0)) __pyx_t_37 = 3;
12970 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_37 = 3;
12971 if (unlikely(__pyx_t_37 != -1)) {
12972 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12973 __PYX_ERR(0, 567, __pyx_L1_error)
12975 __pyx_t_52 = __pyx_v_eN;
12976 __pyx_t_53 = __pyx_v_i;
12978 if (__pyx_t_52 < 0) {
12979 __pyx_t_52 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12980 if (unlikely(__pyx_t_52 < 0)) __pyx_t_37 = 0;
12981 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_37 = 0;
12982 if (__pyx_t_53 < 0) {
12983 __pyx_t_53 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12984 if (unlikely(__pyx_t_53 < 0)) __pyx_t_37 = 1;
12985 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_37 = 1;
12986 if (unlikely(__pyx_t_37 != -1)) {
12987 __Pyx_RaiseBufferIndexError(__pyx_t_37);
12988 __PYX_ERR(0, 567, __pyx_L1_error)
12990 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_51, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
12999 __pyx_t_54 = (__pyx_v_I + 1);
13001 if (__pyx_t_54 < 0) {
13002 __pyx_t_54 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13003 if (unlikely(__pyx_t_54 < 0)) __pyx_t_37 = 0;
13004 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_37 = 0;
13005 if (unlikely(__pyx_t_37 != -1)) {
13006 __Pyx_RaiseBufferIndexError(__pyx_t_37);
13007 __PYX_ERR(0, 568, __pyx_L1_error)
13009 __pyx_t_55 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13010 __pyx_t_56 = __pyx_v_I;
13012 if (__pyx_t_56 < 0) {
13013 __pyx_t_56 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13014 if (unlikely(__pyx_t_56 < 0)) __pyx_t_37 = 0;
13015 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_37 = 0;
13016 if (unlikely(__pyx_t_37 != -1)) {
13017 __Pyx_RaiseBufferIndexError(__pyx_t_37);
13018 __PYX_ERR(0, 568, __pyx_L1_error)
13020 __pyx_t_57 = __pyx_t_55;
13021 for (__pyx_t_37 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_37 < __pyx_t_57; __pyx_t_37+=1) {
13022 __pyx_v_ii = __pyx_t_37;
13031 __pyx_t_58 = __pyx_v_ii;
13033 if (__pyx_t_58 < 0) {
13034 __pyx_t_58 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13035 if (unlikely(__pyx_t_58 < 0)) __pyx_t_59 = 0;
13036 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_59 = 0;
13037 if (unlikely(__pyx_t_59 != -1)) {
13038 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13039 __PYX_ERR(0, 569, __pyx_L1_error)
13041 __pyx_t_60 = __pyx_v_ii;
13043 if (__pyx_t_60 < 0) {
13044 __pyx_t_60 += __pyx_pybuffernd_colind.diminfo[0].shape;
13045 if (unlikely(__pyx_t_60 < 0)) __pyx_t_59 = 0;
13046 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_59 = 0;
13047 if (unlikely(__pyx_t_59 != -1)) {
13048 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13049 __PYX_ERR(0, 569, __pyx_L1_error)
13051 __pyx_t_61 = __pyx_v_eN;
13052 __pyx_t_62 = __pyx_v_ebN;
13053 __pyx_t_63 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_colind.diminfo[0].strides));
13055 if (__pyx_t_61 < 0) {
13056 __pyx_t_61 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
13057 if (unlikely(__pyx_t_61 < 0)) __pyx_t_59 = 0;
13058 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_59 = 0;
13059 if (__pyx_t_62 < 0) {
13060 __pyx_t_62 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
13061 if (unlikely(__pyx_t_62 < 0)) __pyx_t_59 = 1;
13062 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_59 = 1;
13063 if (__pyx_t_63 < 0) {
13064 __pyx_t_63 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
13065 if (unlikely(__pyx_t_63 < 0)) __pyx_t_59 = 2;
13066 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_59 = 2;
13067 if (unlikely(__pyx_t_59 != -1)) {
13068 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13069 __PYX_ERR(0, 569, __pyx_L1_error)
13071 __pyx_t_64 = __pyx_v_eN;
13072 __pyx_t_65 = __pyx_v_ebN;
13073 __pyx_t_66 = __pyx_v_i;
13074 __pyx_t_67 = __pyx_v_I;
13076 if (__pyx_t_64 < 0) {
13077 __pyx_t_64 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
13078 if (unlikely(__pyx_t_64 < 0)) __pyx_t_59 = 0;
13079 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_59 = 0;
13080 if (__pyx_t_65 < 0) {
13081 __pyx_t_65 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
13082 if (unlikely(__pyx_t_65 < 0)) __pyx_t_59 = 1;
13083 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_59 = 1;
13084 if (__pyx_t_66 < 0) {
13085 __pyx_t_66 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
13086 if (unlikely(__pyx_t_66 < 0)) __pyx_t_59 = 2;
13087 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_59 = 2;
13088 if (__pyx_t_67 < 0) {
13089 __pyx_t_67 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
13090 if (unlikely(__pyx_t_67 < 0)) __pyx_t_59 = 3;
13091 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_59 = 3;
13092 if (unlikely(__pyx_t_59 != -1)) {
13093 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13094 __PYX_ERR(0, 569, __pyx_L1_error)
13096 __pyx_t_68 = __pyx_v_eN;
13097 __pyx_t_69 = __pyx_v_i;
13099 if (__pyx_t_68 < 0) {
13100 __pyx_t_68 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
13101 if (unlikely(__pyx_t_68 < 0)) __pyx_t_59 = 0;
13102 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_59 = 0;
13103 if (__pyx_t_69 < 0) {
13104 __pyx_t_69 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
13105 if (unlikely(__pyx_t_69 < 0)) __pyx_t_59 = 1;
13106 }
else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_59 = 1;
13107 if (unlikely(__pyx_t_59 != -1)) {
13108 __Pyx_RaiseBufferIndexError(__pyx_t_59);
13109 __PYX_ERR(0, 569, __pyx_L1_error)
13111 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_68, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_69, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_67, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13127 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13130 __Pyx_XDECREF(__pyx_t_1);
13131 __Pyx_XDECREF(__pyx_t_2);
13132 __Pyx_XDECREF(__pyx_t_4);
13133 __Pyx_XDECREF(__pyx_t_5);
13134 __Pyx_XDECREF(__pyx_t_9);
13135 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13136 __Pyx_PyThreadState_declare
13137 __Pyx_PyThreadState_assign
13138 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13139 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13140 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13141 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13142 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13143 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13144 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13145 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13146 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13147 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13148 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13149 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13150 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13151 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13152 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13153 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13154 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13155 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13156 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13157 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13158 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13159 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
13163 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13164 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13165 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13166 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13167 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13168 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13169 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13170 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13171 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13172 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13173 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13174 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13175 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13176 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13177 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13178 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13179 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13180 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13181 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13183 __Pyx_XDECREF(__pyx_v_q);
13184 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
13185 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
13186 __Pyx_XGIVEREF(__pyx_r);
13187 __Pyx_RefNannyFinishContext();
13200 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13201 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
13202 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
13203 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13204 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
13205 PyArrayObject *__pyx_v_rowptr = 0;
13206 PyArrayObject *__pyx_v_colind = 0;
13207 int __pyx_v_nSpace;
13208 int __pyx_v_nElements_global;
13209 int __pyx_v_nElementBoundaries_element;
13210 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
13211 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
13212 int __pyx_v_nDOF_test_element;
13213 int __pyx_v_nDOF_trial_element;
13214 PyArrayObject *__pyx_v_q_u = 0;
13215 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
13216 PyArrayObject *__pyx_v_q_grad_w = 0;
13217 PyArrayObject *__pyx_v_q_grad_v = 0;
13218 PyArrayObject *__pyx_v_q_detJ = 0;
13219 PyArrayObject *__pyx_v_q_m = 0;
13220 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
13221 PyArrayObject *__pyx_v_q_mt = 0;
13222 PyArrayObject *__pyx_v_q_dmt = 0;
13223 PyArrayObject *__pyx_v_q_r = 0;
13224 PyArrayObject *__pyx_v_q_kr = 0;
13225 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
13226 PyArrayObject *__pyx_v_q_kr_up = 0;
13227 PyArrayObject *__pyx_v_q_flin = 0;
13228 PyArrayObject *__pyx_v_q_alin = 0;
13229 PyArrayObject *__pyx_v_elementJacobian = 0;
13230 PyObject *__pyx_r = 0;
13231 __Pyx_RefNannyDeclarations
13232 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
13234 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
13235 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13236 if (unlikely(__pyx_kwds)) {
13237 Py_ssize_t kw_args;
13238 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13239 switch (pos_args) {
13240 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13241 CYTHON_FALLTHROUGH;
13242 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13243 CYTHON_FALLTHROUGH;
13244 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13245 CYTHON_FALLTHROUGH;
13246 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13247 CYTHON_FALLTHROUGH;
13248 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13249 CYTHON_FALLTHROUGH;
13250 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13251 CYTHON_FALLTHROUGH;
13252 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13253 CYTHON_FALLTHROUGH;
13254 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13255 CYTHON_FALLTHROUGH;
13256 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13257 CYTHON_FALLTHROUGH;
13258 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13259 CYTHON_FALLTHROUGH;
13260 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13261 CYTHON_FALLTHROUGH;
13262 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13263 CYTHON_FALLTHROUGH;
13264 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13265 CYTHON_FALLTHROUGH;
13266 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13267 CYTHON_FALLTHROUGH;
13268 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13269 CYTHON_FALLTHROUGH;
13270 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13271 CYTHON_FALLTHROUGH;
13272 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13273 CYTHON_FALLTHROUGH;
13274 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13275 CYTHON_FALLTHROUGH;
13276 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13277 CYTHON_FALLTHROUGH;
13278 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13279 CYTHON_FALLTHROUGH;
13280 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13281 CYTHON_FALLTHROUGH;
13282 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13283 CYTHON_FALLTHROUGH;
13284 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13285 CYTHON_FALLTHROUGH;
13286 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13287 CYTHON_FALLTHROUGH;
13288 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13289 CYTHON_FALLTHROUGH;
13290 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13291 CYTHON_FALLTHROUGH;
13293 default:
goto __pyx_L5_argtuple_error;
13295 kw_args = PyDict_Size(__pyx_kwds);
13296 switch (pos_args) {
13298 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
13299 else goto __pyx_L5_argtuple_error;
13300 CYTHON_FALLTHROUGH;
13302 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
13304 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); __PYX_ERR(0, 574, __pyx_L3_error)
13306 CYTHON_FALLTHROUGH;
13308 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
13310 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); __PYX_ERR(0, 574, __pyx_L3_error)
13312 CYTHON_FALLTHROUGH;
13314 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
13316 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); __PYX_ERR(0, 574, __pyx_L3_error)
13318 CYTHON_FALLTHROUGH;
13320 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
13322 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); __PYX_ERR(0, 574, __pyx_L3_error)
13324 CYTHON_FALLTHROUGH;
13326 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
13328 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); __PYX_ERR(0, 574, __pyx_L3_error)
13330 CYTHON_FALLTHROUGH;
13332 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
13334 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); __PYX_ERR(0, 574, __pyx_L3_error)
13336 CYTHON_FALLTHROUGH;
13338 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
13340 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); __PYX_ERR(0, 574, __pyx_L3_error)
13342 CYTHON_FALLTHROUGH;
13344 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
13346 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); __PYX_ERR(0, 574, __pyx_L3_error)
13348 CYTHON_FALLTHROUGH;
13350 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
13352 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); __PYX_ERR(0, 574, __pyx_L3_error)
13354 CYTHON_FALLTHROUGH;
13356 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
13358 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); __PYX_ERR(0, 574, __pyx_L3_error)
13360 CYTHON_FALLTHROUGH;
13362 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
13364 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); __PYX_ERR(0, 574, __pyx_L3_error)
13366 CYTHON_FALLTHROUGH;
13368 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
13370 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); __PYX_ERR(0, 574, __pyx_L3_error)
13372 CYTHON_FALLTHROUGH;
13374 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
13376 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); __PYX_ERR(0, 574, __pyx_L3_error)
13378 CYTHON_FALLTHROUGH;
13380 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
13382 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); __PYX_ERR(0, 574, __pyx_L3_error)
13384 CYTHON_FALLTHROUGH;
13386 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
13388 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); __PYX_ERR(0, 574, __pyx_L3_error)
13390 CYTHON_FALLTHROUGH;
13392 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
13394 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); __PYX_ERR(0, 574, __pyx_L3_error)
13396 CYTHON_FALLTHROUGH;
13398 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
13400 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); __PYX_ERR(0, 574, __pyx_L3_error)
13402 CYTHON_FALLTHROUGH;
13404 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
13406 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); __PYX_ERR(0, 574, __pyx_L3_error)
13408 CYTHON_FALLTHROUGH;
13410 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
13412 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); __PYX_ERR(0, 574, __pyx_L3_error)
13414 CYTHON_FALLTHROUGH;
13416 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
13418 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); __PYX_ERR(0, 574, __pyx_L3_error)
13420 CYTHON_FALLTHROUGH;
13422 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
13424 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); __PYX_ERR(0, 574, __pyx_L3_error)
13426 CYTHON_FALLTHROUGH;
13428 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
13430 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); __PYX_ERR(0, 574, __pyx_L3_error)
13432 CYTHON_FALLTHROUGH;
13434 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
13436 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); __PYX_ERR(0, 574, __pyx_L3_error)
13438 CYTHON_FALLTHROUGH;
13440 if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
13442 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); __PYX_ERR(0, 574, __pyx_L3_error)
13444 CYTHON_FALLTHROUGH;
13446 if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
13448 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); __PYX_ERR(0, 574, __pyx_L3_error)
13451 if (unlikely(kw_args > 0)) {
13452 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
13454 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
13455 goto __pyx_L5_argtuple_error;
13457 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13458 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13459 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13460 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13461 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13462 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13463 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13464 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13465 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13466 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13467 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13468 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13469 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13470 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13471 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13472 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13473 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13474 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13475 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13476 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13477 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13478 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13479 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13480 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13481 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13482 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13484 __pyx_v_gravity = ((PyArrayObject *)values[0]);
13485 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
13486 __pyx_v_colind = ((PyArrayObject *)values[2]);
13487 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
13488 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
13489 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
13490 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
13491 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
13492 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error)
13493 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
13494 __pyx_v_q_u = ((PyArrayObject *)values[10]);
13495 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
13496 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
13497 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
13498 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
13499 __pyx_v_q_m = ((PyArrayObject *)values[15]);
13500 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
13501 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
13502 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
13503 __pyx_v_q_r = ((PyArrayObject *)values[19]);
13504 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
13505 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
13506 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
13507 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
13508 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
13509 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
13511 goto __pyx_L4_argument_unpacking_done;
13512 __pyx_L5_argtuple_error:;
13513 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
13515 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
13516 __Pyx_RefNannyFinishContext();
13518 __pyx_L4_argument_unpacking_done:;
13519 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 574, __pyx_L1_error)
13520 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
13521 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
13522 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 581, __pyx_L1_error)
13523 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
13524 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 586, __pyx_L1_error)
13525 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
13526 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
13527 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
13528 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 591, __pyx_L1_error)
13529 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
13530 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
13531 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
13532 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
13533 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
13534 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
13535 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
13536 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
13537 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 602, __pyx_L1_error)
13538 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
13539 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
13540 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
13547 __Pyx_RefNannyFinishContext();
13551 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
13552 CYTHON_UNUSED
int __pyx_v_upwindFlag;
13553 CYTHON_UNUSED
int __pyx_v_picard;
13554 PyObject *__pyx_v_q = NULL;
13559 PyArrayObject *__pyx_v_a_up = 0;
13560 PyArrayObject *__pyx_v_f_up = 0;
13561 double __pyx_v_nAvgWeight;
13562 double __pyx_v_weight;
13563 double __pyx_v_volFactor;
13564 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
13565 double __pyx_v_volume;
13569 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
13570 __Pyx_Buffer __pyx_pybuffer_a_up;
13571 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13572 __Pyx_Buffer __pyx_pybuffer_colind;
13573 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
13574 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
13575 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
13576 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
13577 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13578 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13579 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
13580 __Pyx_Buffer __pyx_pybuffer_f_up;
13581 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13582 __Pyx_Buffer __pyx_pybuffer_gravity;
13583 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13584 __Pyx_Buffer __pyx_pybuffer_q_alin;
13585 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
13586 __Pyx_Buffer __pyx_pybuffer_q_detJ;
13587 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
13588 __Pyx_Buffer __pyx_pybuffer_q_dkr;
13589 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
13590 __Pyx_Buffer __pyx_pybuffer_q_dm;
13591 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
13592 __Pyx_Buffer __pyx_pybuffer_q_dmt;
13593 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13594 __Pyx_Buffer __pyx_pybuffer_q_flin;
13595 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
13596 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
13597 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
13598 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
13599 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
13600 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
13601 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
13602 __Pyx_Buffer __pyx_pybuffer_q_kr;
13603 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
13604 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
13605 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
13606 __Pyx_Buffer __pyx_pybuffer_q_m;
13607 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
13608 __Pyx_Buffer __pyx_pybuffer_q_mt;
13609 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
13610 __Pyx_Buffer __pyx_pybuffer_q_r;
13611 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
13612 __Pyx_Buffer __pyx_pybuffer_q_u;
13613 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13614 __Pyx_Buffer __pyx_pybuffer_rowptr;
13615 PyObject *__pyx_r = NULL;
13616 __Pyx_RefNannyDeclarations
13617 PyObject *__pyx_t_1 = NULL;
13618 PyObject *__pyx_t_2 = NULL;
13619 Py_ssize_t __pyx_t_3;
13620 PyObject *__pyx_t_4 = NULL;
13621 PyObject *__pyx_t_5 = NULL;
13623 Py_ssize_t __pyx_t_7;
13625 PyObject *__pyx_t_9 = NULL;
13626 PyArrayObject *__pyx_t_10 = NULL;
13627 PyArrayObject *__pyx_t_11 = NULL;
13631 Py_ssize_t __pyx_t_15;
13632 Py_ssize_t __pyx_t_16;
13636 Py_ssize_t __pyx_t_20;
13637 Py_ssize_t __pyx_t_21;
13639 Py_ssize_t __pyx_t_23;
13640 Py_ssize_t __pyx_t_24;
13641 Py_ssize_t __pyx_t_25;
13647 Py_ssize_t __pyx_t_31;
13648 Py_ssize_t __pyx_t_32;
13649 Py_ssize_t __pyx_t_33;
13651 Py_ssize_t __pyx_t_35;
13652 Py_ssize_t __pyx_t_36;
13653 Py_ssize_t __pyx_t_37;
13654 Py_ssize_t __pyx_t_38;
13655 Py_ssize_t __pyx_t_39;
13656 Py_ssize_t __pyx_t_40;
13657 Py_ssize_t __pyx_t_41;
13658 Py_ssize_t __pyx_t_42;
13659 Py_ssize_t __pyx_t_43;
13662 Py_ssize_t __pyx_t_46;
13664 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_48;
13665 Py_ssize_t __pyx_t_49;
13666 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_50;
13667 Py_ssize_t __pyx_t_51;
13669 Py_ssize_t __pyx_t_53;
13670 Py_ssize_t __pyx_t_54;
13671 Py_ssize_t __pyx_t_55;
13672 Py_ssize_t __pyx_t_56;
13673 Py_ssize_t __pyx_t_57;
13674 Py_ssize_t __pyx_t_58;
13675 Py_ssize_t __pyx_t_59;
13676 Py_ssize_t __pyx_t_60;
13677 Py_ssize_t __pyx_t_61;
13678 Py_ssize_t __pyx_t_62;
13679 Py_ssize_t __pyx_t_63;
13680 Py_ssize_t __pyx_t_64;
13681 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
13682 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
13683 __pyx_pybuffer_a_up.refcount = 0;
13684 __pyx_pybuffernd_a_up.data = NULL;
13685 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
13686 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
13687 __pyx_pybuffer_f_up.refcount = 0;
13688 __pyx_pybuffernd_f_up.data = NULL;
13689 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
13690 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13691 __pyx_pybuffer_gravity.refcount = 0;
13692 __pyx_pybuffernd_gravity.data = NULL;
13693 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13694 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13695 __pyx_pybuffer_rowptr.refcount = 0;
13696 __pyx_pybuffernd_rowptr.data = NULL;
13697 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13698 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13699 __pyx_pybuffer_colind.refcount = 0;
13700 __pyx_pybuffernd_colind.data = NULL;
13701 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13702 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13703 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13704 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13705 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13706 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
13707 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
13708 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
13709 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
13710 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
13711 __pyx_pybuffer_q_u.refcount = 0;
13712 __pyx_pybuffernd_q_u.data = NULL;
13713 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
13714 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
13715 __pyx_pybuffer_q_grad_u.refcount = 0;
13716 __pyx_pybuffernd_q_grad_u.data = NULL;
13717 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
13718 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
13719 __pyx_pybuffer_q_grad_w.refcount = 0;
13720 __pyx_pybuffernd_q_grad_w.data = NULL;
13721 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
13722 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
13723 __pyx_pybuffer_q_grad_v.refcount = 0;
13724 __pyx_pybuffernd_q_grad_v.data = NULL;
13725 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
13726 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
13727 __pyx_pybuffer_q_detJ.refcount = 0;
13728 __pyx_pybuffernd_q_detJ.data = NULL;
13729 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
13730 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
13731 __pyx_pybuffer_q_m.refcount = 0;
13732 __pyx_pybuffernd_q_m.data = NULL;
13733 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
13734 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
13735 __pyx_pybuffer_q_dm.refcount = 0;
13736 __pyx_pybuffernd_q_dm.data = NULL;
13737 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
13738 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
13739 __pyx_pybuffer_q_mt.refcount = 0;
13740 __pyx_pybuffernd_q_mt.data = NULL;
13741 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
13742 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
13743 __pyx_pybuffer_q_dmt.refcount = 0;
13744 __pyx_pybuffernd_q_dmt.data = NULL;
13745 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
13746 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
13747 __pyx_pybuffer_q_r.refcount = 0;
13748 __pyx_pybuffernd_q_r.data = NULL;
13749 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
13750 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
13751 __pyx_pybuffer_q_kr.refcount = 0;
13752 __pyx_pybuffernd_q_kr.data = NULL;
13753 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
13754 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
13755 __pyx_pybuffer_q_dkr.refcount = 0;
13756 __pyx_pybuffernd_q_dkr.data = NULL;
13757 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
13758 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
13759 __pyx_pybuffer_q_kr_up.refcount = 0;
13760 __pyx_pybuffernd_q_kr_up.data = NULL;
13761 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
13762 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13763 __pyx_pybuffer_q_flin.refcount = 0;
13764 __pyx_pybuffernd_q_flin.data = NULL;
13765 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13766 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13767 __pyx_pybuffer_q_alin.refcount = 0;
13768 __pyx_pybuffernd_q_alin.data = NULL;
13769 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13770 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
13771 __pyx_pybuffer_elementJacobian.refcount = 0;
13772 __pyx_pybuffernd_elementJacobian.data = NULL;
13773 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
13775 __Pyx_BufFmt_StackElem __pyx_stack[1];
13776 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13778 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13780 __Pyx_BufFmt_StackElem __pyx_stack[1];
13781 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13783 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13785 __Pyx_BufFmt_StackElem __pyx_stack[1];
13786 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13788 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13790 __Pyx_BufFmt_StackElem __pyx_stack[1];
13791 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13793 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13795 __Pyx_BufFmt_StackElem __pyx_stack[1];
13796 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13798 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
13800 __Pyx_BufFmt_StackElem __pyx_stack[1];
13801 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13803 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
13805 __Pyx_BufFmt_StackElem __pyx_stack[1];
13806 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13808 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
13810 __Pyx_BufFmt_StackElem __pyx_stack[1];
13811 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13813 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
13815 __Pyx_BufFmt_StackElem __pyx_stack[1];
13816 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13818 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
13820 __Pyx_BufFmt_StackElem __pyx_stack[1];
13821 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13823 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
13825 __Pyx_BufFmt_StackElem __pyx_stack[1];
13826 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13828 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
13830 __Pyx_BufFmt_StackElem __pyx_stack[1];
13831 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13833 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
13835 __Pyx_BufFmt_StackElem __pyx_stack[1];
13836 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13838 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
13840 __Pyx_BufFmt_StackElem __pyx_stack[1];
13841 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13843 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
13845 __Pyx_BufFmt_StackElem __pyx_stack[1];
13846 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13848 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
13850 __Pyx_BufFmt_StackElem __pyx_stack[1];
13851 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13853 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
13855 __Pyx_BufFmt_StackElem __pyx_stack[1];
13856 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13858 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
13860 __Pyx_BufFmt_StackElem __pyx_stack[1];
13861 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13863 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
13865 __Pyx_BufFmt_StackElem __pyx_stack[1];
13866 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13868 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13870 __Pyx_BufFmt_StackElem __pyx_stack[1];
13871 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13873 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13875 __Pyx_BufFmt_StackElem __pyx_stack[1];
13876 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13878 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
13887 __pyx_v_upwindFlag = 1;
13896 __pyx_v_picard = 1;
13905 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13906 __Pyx_GOTREF(__pyx_t_1);
13907 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
13908 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
13909 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
13910 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
13911 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
13912 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
13913 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
13914 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
13915 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
13916 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
13917 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
13918 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
13919 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
13920 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
13921 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
13922 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13925 if (__pyx_t_3 >= 5)
break;
13926 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13927 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
13929 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13930 __Pyx_GOTREF(__pyx_t_1);
13932 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
13942 #ifndef CYTHON_WITHOUT_ASSERTIONS
13943 if (unlikely(!Py_OptimizeFlag)) {
13944 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13945 __Pyx_GOTREF(__pyx_t_1);
13946 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
13947 __Pyx_GOTREF(__pyx_t_4);
13948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13949 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13950 __Pyx_GOTREF(__pyx_t_1);
13951 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
13952 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13953 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13954 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
13955 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13956 if (unlikely(!__pyx_t_6)) {
13957 PyErr_SetNone(PyExc_AssertionError);
13958 __PYX_ERR(0, 624, __pyx_L1_error)
13971 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13980 #ifndef CYTHON_WITHOUT_ASSERTIONS
13981 if (unlikely(!Py_OptimizeFlag)) {
13982 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
13983 PyErr_SetNone(PyExc_AssertionError);
13984 __PYX_ERR(0, 625, __pyx_L1_error)
13996 __pyx_t_7 = __pyx_v_nSpace;
13998 if (__pyx_t_7 < 0) {
13999 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14000 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
14001 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
14002 if (unlikely(__pyx_t_8 != -1)) {
14003 __Pyx_RaiseBufferIndexError(__pyx_t_8);
14004 __PYX_ERR(0, 626, __pyx_L1_error)
14006 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14015 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
14016 __Pyx_GOTREF(__pyx_t_5);
14017 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
14018 __Pyx_GOTREF(__pyx_t_1);
14019 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14020 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
14021 __Pyx_GOTREF(__pyx_t_5);
14024 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
14025 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
14026 if (likely(__pyx_t_4)) {
14027 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
14028 __Pyx_INCREF(__pyx_t_4);
14029 __Pyx_INCREF(
function);
14030 __Pyx_DECREF_SET(__pyx_t_1,
function);
14034 #if CYTHON_FAST_PYCALL
14035 if (PyFunction_Check(__pyx_t_1)) {
14036 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
14037 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14038 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14039 __Pyx_GOTREF(__pyx_t_2);
14040 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14043 #if CYTHON_FAST_PYCCALL
14044 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
14045 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
14046 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14047 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14048 __Pyx_GOTREF(__pyx_t_2);
14049 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14053 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error)
14054 __Pyx_GOTREF(__pyx_t_9);
14056 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
14058 __Pyx_GIVEREF(__pyx_t_5);
14059 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
14060 __Pyx_INCREF(__pyx_n_s_d);
14061 __Pyx_GIVEREF(__pyx_n_s_d);
14062 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
14064 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
14065 __Pyx_GOTREF(__pyx_t_2);
14066 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14068 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14069 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
14070 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
14072 __Pyx_BufFmt_StackElem __pyx_stack[1];
14073 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14074 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
14075 __PYX_ERR(0, 630, __pyx_L1_error)
14076 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
14080 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
14090 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14091 __Pyx_GOTREF(__pyx_t_1);
14092 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error)
14093 __Pyx_GOTREF(__pyx_t_9);
14094 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14095 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14096 __Pyx_GOTREF(__pyx_t_1);
14099 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14100 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
14101 if (likely(__pyx_t_5)) {
14102 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14103 __Pyx_INCREF(__pyx_t_5);
14104 __Pyx_INCREF(
function);
14105 __Pyx_DECREF_SET(__pyx_t_9,
function);
14109 #if CYTHON_FAST_PYCALL
14110 if (PyFunction_Check(__pyx_t_9)) {
14111 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14112 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14113 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14114 __Pyx_GOTREF(__pyx_t_2);
14115 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14118 #if CYTHON_FAST_PYCCALL
14119 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14120 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14121 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14122 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14123 __Pyx_GOTREF(__pyx_t_2);
14124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14128 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
14129 __Pyx_GOTREF(__pyx_t_4);
14131 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
14133 __Pyx_GIVEREF(__pyx_t_1);
14134 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
14135 __Pyx_INCREF(__pyx_n_s_d);
14136 __Pyx_GIVEREF(__pyx_n_s_d);
14137 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
14139 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14140 __Pyx_GOTREF(__pyx_t_2);
14141 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14143 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14144 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
14145 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
14147 __Pyx_BufFmt_StackElem __pyx_stack[1];
14148 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14149 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
14150 __PYX_ERR(0, 631, __pyx_L1_error)
14151 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
14155 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
14165 __pyx_t_12 = (__pyx_v_nSpace + 1.);
14166 if (unlikely(__pyx_t_12 == 0)) {
14167 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14168 __PYX_ERR(0, 633, __pyx_L1_error)
14170 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
14179 __pyx_v_weight = 1.0;
14180 __pyx_v_volFactor = 1.0;
14189 __pyx_v_thisElementIsUpwind = 1;
14198 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
14208 __pyx_v_volFactor = 0.5;
14226 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
14236 __pyx_v_volFactor = (1.0 / 6.0);
14254 __pyx_t_8 = __pyx_v_nElements_global;
14255 __pyx_t_13 = __pyx_t_8;
14256 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
14257 __pyx_v_eN = __pyx_t_14;
14266 __pyx_t_15 = __pyx_v_eN;
14269 if (__pyx_t_15 < 0) {
14270 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
14271 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
14272 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_17 = 0;
14273 if (__pyx_t_16 < 0) {
14274 __pyx_t_16 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
14275 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
14276 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_17 = 1;
14277 if (unlikely(__pyx_t_17 != -1)) {
14278 __Pyx_RaiseBufferIndexError(__pyx_t_17);
14279 __PYX_ERR(0, 642, __pyx_L1_error)
14281 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
14290 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
14299 __pyx_t_17 = __pyx_v_nDOF_test_element;
14300 __pyx_t_18 = __pyx_t_17;
14301 for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
14302 __pyx_v_i = __pyx_t_19;
14311 __pyx_t_20 = __pyx_v_eN;
14312 __pyx_t_21 = __pyx_v_i;
14314 if (__pyx_t_20 < 0) {
14315 __pyx_t_20 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
14316 if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 0;
14317 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_22 = 0;
14318 if (__pyx_t_21 < 0) {
14319 __pyx_t_21 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
14320 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 1;
14321 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_22 = 1;
14322 if (unlikely(__pyx_t_22 != -1)) {
14323 __Pyx_RaiseBufferIndexError(__pyx_t_22);
14324 __PYX_ERR(0, 650, __pyx_L1_error)
14326 __pyx_t_23 = __pyx_v_eN;
14327 __pyx_t_24 = __pyx_v_i;
14328 __pyx_t_25 = __pyx_v_i;
14330 if (__pyx_t_23 < 0) {
14331 __pyx_t_23 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14332 if (unlikely(__pyx_t_23 < 0)) __pyx_t_22 = 0;
14333 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_22 = 0;
14334 if (__pyx_t_24 < 0) {
14335 __pyx_t_24 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14336 if (unlikely(__pyx_t_24 < 0)) __pyx_t_22 = 1;
14337 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_22 = 1;
14338 if (__pyx_t_25 < 0) {
14339 __pyx_t_25 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14340 if (unlikely(__pyx_t_25 < 0)) __pyx_t_22 = 2;
14341 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_22 = 2;
14342 if (unlikely(__pyx_t_22 != -1)) {
14343 __Pyx_RaiseBufferIndexError(__pyx_t_22);
14344 __PYX_ERR(0, 650, __pyx_L1_error)
14346 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
14355 __pyx_t_22 = __pyx_v_nElementBoundaries_element;
14356 __pyx_t_26 = __pyx_t_22;
14357 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14358 __pyx_v_ebN = __pyx_t_27;
14367 __pyx_t_28 = __pyx_v_nnz;
14368 __pyx_t_29 = __pyx_t_28;
14369 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
14370 __pyx_v_ii = __pyx_t_30;
14379 __pyx_t_31 = __pyx_v_eN;
14380 __pyx_t_32 = __pyx_v_ebN;
14381 __pyx_t_33 = __pyx_v_ii;
14383 if (__pyx_t_31 < 0) {
14384 __pyx_t_31 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
14385 if (unlikely(__pyx_t_31 < 0)) __pyx_t_34 = 0;
14386 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_34 = 0;
14387 if (__pyx_t_32 < 0) {
14388 __pyx_t_32 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
14389 if (unlikely(__pyx_t_32 < 0)) __pyx_t_34 = 1;
14390 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_34 = 1;
14391 if (__pyx_t_33 < 0) {
14392 __pyx_t_33 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
14393 if (unlikely(__pyx_t_33 < 0)) __pyx_t_34 = 2;
14394 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_34 = 2;
14395 if (unlikely(__pyx_t_34 != -1)) {
14396 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14397 __PYX_ERR(0, 656, __pyx_L1_error)
14399 __pyx_t_35 = __pyx_v_eN;
14400 __pyx_t_36 = __pyx_v_ebN;
14402 if (__pyx_t_35 < 0) {
14403 __pyx_t_35 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14404 if (unlikely(__pyx_t_35 < 0)) __pyx_t_34 = 0;
14405 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_34 = 0;
14406 if (__pyx_t_36 < 0) {
14407 __pyx_t_36 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14408 if (unlikely(__pyx_t_36 < 0)) __pyx_t_34 = 1;
14409 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_34 = 1;
14410 if (unlikely(__pyx_t_34 != -1)) {
14411 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14412 __PYX_ERR(0, 656, __pyx_L1_error)
14414 __pyx_t_37 = __pyx_v_ii;
14416 if (__pyx_t_37 < 0) {
14417 __pyx_t_37 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14418 if (unlikely(__pyx_t_37 < 0)) __pyx_t_34 = 0;
14419 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_34 = 0;
14420 if (unlikely(__pyx_t_34 != -1)) {
14421 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14422 __PYX_ERR(0, 656, __pyx_L1_error)
14424 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14434 __pyx_t_28 = __pyx_v_nSpace;
14435 __pyx_t_29 = __pyx_t_28;
14436 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
14437 __pyx_v_I = __pyx_t_30;
14446 __pyx_t_38 = __pyx_v_eN;
14447 __pyx_t_39 = __pyx_v_ebN;
14448 __pyx_t_40 = __pyx_v_I;
14450 if (__pyx_t_38 < 0) {
14451 __pyx_t_38 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14452 if (unlikely(__pyx_t_38 < 0)) __pyx_t_34 = 0;
14453 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_34 = 0;
14454 if (__pyx_t_39 < 0) {
14455 __pyx_t_39 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14456 if (unlikely(__pyx_t_39 < 0)) __pyx_t_34 = 1;
14457 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_34 = 1;
14458 if (__pyx_t_40 < 0) {
14459 __pyx_t_40 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14460 if (unlikely(__pyx_t_40 < 0)) __pyx_t_34 = 2;
14461 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_34 = 2;
14462 if (unlikely(__pyx_t_34 != -1)) {
14463 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14464 __PYX_ERR(0, 658, __pyx_L1_error)
14466 __pyx_t_41 = __pyx_v_eN;
14467 __pyx_t_42 = __pyx_v_ebN;
14469 if (__pyx_t_41 < 0) {
14470 __pyx_t_41 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14471 if (unlikely(__pyx_t_41 < 0)) __pyx_t_34 = 0;
14472 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_34 = 0;
14473 if (__pyx_t_42 < 0) {
14474 __pyx_t_42 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14475 if (unlikely(__pyx_t_42 < 0)) __pyx_t_34 = 1;
14476 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_34 = 1;
14477 if (unlikely(__pyx_t_34 != -1)) {
14478 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14479 __PYX_ERR(0, 658, __pyx_L1_error)
14481 __pyx_t_43 = __pyx_v_I;
14483 if (__pyx_t_43 < 0) {
14484 __pyx_t_43 += __pyx_pybuffernd_f_up.diminfo[0].shape;
14485 if (unlikely(__pyx_t_43 < 0)) __pyx_t_34 = 0;
14486 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_34 = 0;
14487 if (unlikely(__pyx_t_34 != -1)) {
14488 __Pyx_RaiseBufferIndexError(__pyx_t_34);
14489 __PYX_ERR(0, 658, __pyx_L1_error)
14491 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14501 __pyx_t_28 = __pyx_v_nDOF_trial_element;
14502 __pyx_t_29 = __pyx_t_28;
14503 for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
14504 __pyx_v_j = __pyx_t_30;
14513 __pyx_t_34 = __pyx_v_nSpace;
14514 __pyx_t_44 = __pyx_t_34;
14515 for (__pyx_t_45 = 0; __pyx_t_45 < __pyx_t_44; __pyx_t_45+=1) {
14516 __pyx_v_I = __pyx_t_45;
14525 __pyx_t_46 = (__pyx_v_I + 1);
14527 if (__pyx_t_46 < 0) {
14528 __pyx_t_46 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14529 if (unlikely(__pyx_t_46 < 0)) __pyx_t_47 = 0;
14530 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_47 = 0;
14531 if (unlikely(__pyx_t_47 != -1)) {
14532 __Pyx_RaiseBufferIndexError(__pyx_t_47);
14533 __PYX_ERR(0, 664, __pyx_L1_error)
14535 __pyx_t_48 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14536 __pyx_t_49 = __pyx_v_I;
14538 if (__pyx_t_49 < 0) {
14539 __pyx_t_49 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14540 if (unlikely(__pyx_t_49 < 0)) __pyx_t_47 = 0;
14541 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_47 = 0;
14542 if (unlikely(__pyx_t_47 != -1)) {
14543 __Pyx_RaiseBufferIndexError(__pyx_t_47);
14544 __PYX_ERR(0, 664, __pyx_L1_error)
14546 __pyx_t_50 = __pyx_t_48;
14547 for (__pyx_t_47 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_47 < __pyx_t_50; __pyx_t_47+=1) {
14548 __pyx_v_ii = __pyx_t_47;
14557 __pyx_t_51 = __pyx_v_ii;
14559 if (__pyx_t_51 < 0) {
14560 __pyx_t_51 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14561 if (unlikely(__pyx_t_51 < 0)) __pyx_t_52 = 0;
14562 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_52 = 0;
14563 if (unlikely(__pyx_t_52 != -1)) {
14564 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14565 __PYX_ERR(0, 665, __pyx_L1_error)
14567 __pyx_t_53 = __pyx_v_ii;
14569 if (__pyx_t_53 < 0) {
14570 __pyx_t_53 += __pyx_pybuffernd_colind.diminfo[0].shape;
14571 if (unlikely(__pyx_t_53 < 0)) __pyx_t_52 = 0;
14572 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_52 = 0;
14573 if (unlikely(__pyx_t_52 != -1)) {
14574 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14575 __PYX_ERR(0, 665, __pyx_L1_error)
14577 __pyx_t_54 = __pyx_v_eN;
14578 __pyx_t_55 = __pyx_v_ebN;
14579 __pyx_t_56 = __pyx_v_j;
14580 __pyx_t_57 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_colind.diminfo[0].strides));
14582 if (__pyx_t_54 < 0) {
14583 __pyx_t_54 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
14584 if (unlikely(__pyx_t_54 < 0)) __pyx_t_52 = 0;
14585 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_52 = 0;
14586 if (__pyx_t_55 < 0) {
14587 __pyx_t_55 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
14588 if (unlikely(__pyx_t_55 < 0)) __pyx_t_52 = 1;
14589 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_52 = 1;
14590 if (__pyx_t_56 < 0) {
14591 __pyx_t_56 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
14592 if (unlikely(__pyx_t_56 < 0)) __pyx_t_52 = 2;
14593 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_52 = 2;
14594 if (__pyx_t_57 < 0) {
14595 __pyx_t_57 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
14596 if (unlikely(__pyx_t_57 < 0)) __pyx_t_52 = 3;
14597 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_52 = 3;
14598 if (unlikely(__pyx_t_52 != -1)) {
14599 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14600 __PYX_ERR(0, 665, __pyx_L1_error)
14602 __pyx_t_58 = __pyx_v_eN;
14603 __pyx_t_59 = __pyx_v_ebN;
14604 __pyx_t_60 = __pyx_v_i;
14605 __pyx_t_61 = __pyx_v_I;
14607 if (__pyx_t_58 < 0) {
14608 __pyx_t_58 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
14609 if (unlikely(__pyx_t_58 < 0)) __pyx_t_52 = 0;
14610 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_52 = 0;
14611 if (__pyx_t_59 < 0) {
14612 __pyx_t_59 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
14613 if (unlikely(__pyx_t_59 < 0)) __pyx_t_52 = 1;
14614 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_52 = 1;
14615 if (__pyx_t_60 < 0) {
14616 __pyx_t_60 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
14617 if (unlikely(__pyx_t_60 < 0)) __pyx_t_52 = 2;
14618 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_52 = 2;
14619 if (__pyx_t_61 < 0) {
14620 __pyx_t_61 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
14621 if (unlikely(__pyx_t_61 < 0)) __pyx_t_52 = 3;
14622 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_52 = 3;
14623 if (unlikely(__pyx_t_52 != -1)) {
14624 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14625 __PYX_ERR(0, 665, __pyx_L1_error)
14627 __pyx_t_62 = __pyx_v_eN;
14628 __pyx_t_63 = __pyx_v_i;
14629 __pyx_t_64 = __pyx_v_j;
14631 if (__pyx_t_62 < 0) {
14632 __pyx_t_62 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14633 if (unlikely(__pyx_t_62 < 0)) __pyx_t_52 = 0;
14634 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_52 = 0;
14635 if (__pyx_t_63 < 0) {
14636 __pyx_t_63 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14637 if (unlikely(__pyx_t_63 < 0)) __pyx_t_52 = 1;
14638 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_52 = 1;
14639 if (__pyx_t_64 < 0) {
14640 __pyx_t_64 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14641 if (unlikely(__pyx_t_64 < 0)) __pyx_t_52 = 2;
14642 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_52 = 2;
14643 if (unlikely(__pyx_t_52 != -1)) {
14644 __Pyx_RaiseBufferIndexError(__pyx_t_52);
14645 __PYX_ERR(0, 665, __pyx_L1_error)
14647 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_64, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_57, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_61, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
14664 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14667 __Pyx_XDECREF(__pyx_t_1);
14668 __Pyx_XDECREF(__pyx_t_2);
14669 __Pyx_XDECREF(__pyx_t_4);
14670 __Pyx_XDECREF(__pyx_t_5);
14671 __Pyx_XDECREF(__pyx_t_9);
14672 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14673 __Pyx_PyThreadState_declare
14674 __Pyx_PyThreadState_assign
14675 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14676 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14677 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14678 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14679 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14680 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14681 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14682 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14683 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14684 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14685 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14686 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14687 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14688 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14689 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14690 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14691 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14692 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14693 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14694 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14695 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14696 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14697 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14698 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14699 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14700 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
14704 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14705 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14706 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14707 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14708 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14709 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14710 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14711 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14712 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14713 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14714 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14715 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14716 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14717 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14718 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14719 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14720 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14721 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14722 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14723 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14724 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14725 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14726 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14728 __Pyx_XDECREF(__pyx_v_q);
14729 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
14730 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
14731 __Pyx_XGIVEREF(__pyx_r);
14732 __Pyx_RefNannyFinishContext();
14745 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14746 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
14747 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
14748 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14749 PyArrayObject *__pyx_v_mt = 0;
14750 PyArrayObject *__pyx_v_w = 0;
14751 PyArrayObject *__pyx_v_dV = 0;
14752 PyArrayObject *__pyx_v_weak_residual = 0;
14753 PyObject *__pyx_r = 0;
14754 __Pyx_RefNannyDeclarations
14755 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
14757 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
14758 PyObject* values[4] = {0,0,0,0};
14759 if (unlikely(__pyx_kwds)) {
14760 Py_ssize_t kw_args;
14761 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14762 switch (pos_args) {
14763 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14764 CYTHON_FALLTHROUGH;
14765 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14766 CYTHON_FALLTHROUGH;
14767 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14768 CYTHON_FALLTHROUGH;
14769 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14770 CYTHON_FALLTHROUGH;
14772 default:
goto __pyx_L5_argtuple_error;
14774 kw_args = PyDict_Size(__pyx_kwds);
14775 switch (pos_args) {
14777 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
14778 else goto __pyx_L5_argtuple_error;
14779 CYTHON_FALLTHROUGH;
14781 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14783 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); __PYX_ERR(0, 673, __pyx_L3_error)
14785 CYTHON_FALLTHROUGH;
14787 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14789 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); __PYX_ERR(0, 673, __pyx_L3_error)
14791 CYTHON_FALLTHROUGH;
14793 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
14795 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); __PYX_ERR(0, 673, __pyx_L3_error)
14798 if (unlikely(kw_args > 0)) {
14799 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
14801 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14802 goto __pyx_L5_argtuple_error;
14804 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14805 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14806 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14807 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14809 __pyx_v_mt = ((PyArrayObject *)values[0]);
14810 __pyx_v_w = ((PyArrayObject *)values[1]);
14811 __pyx_v_dV = ((PyArrayObject *)values[2]);
14812 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
14814 goto __pyx_L4_argument_unpacking_done;
14815 __pyx_L5_argtuple_error:;
14816 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 673, __pyx_L3_error)
14818 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14819 __Pyx_RefNannyFinishContext();
14821 __pyx_L4_argument_unpacking_done:;
14822 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
14823 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
14824 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
14825 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
14826 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
14833 __Pyx_RefNannyFinishContext();
14837 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
14841 PyObject *__pyx_v_mt_avg = 0;
14842 PyObject *__pyx_v_vol = 0;
14843 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14844 __Pyx_Buffer __pyx_pybuffer_dV;
14845 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
14846 __Pyx_Buffer __pyx_pybuffer_mt;
14847 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14848 __Pyx_Buffer __pyx_pybuffer_w;
14849 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
14850 __Pyx_Buffer __pyx_pybuffer_weak_residual;
14851 PyObject *__pyx_r = NULL;
14852 __Pyx_RefNannyDeclarations
14853 npy_intp __pyx_t_1;
14854 npy_intp __pyx_t_2;
14856 npy_intp __pyx_t_4;
14857 npy_intp __pyx_t_5;
14859 Py_ssize_t __pyx_t_7;
14860 Py_ssize_t __pyx_t_8;
14862 Py_ssize_t __pyx_t_10;
14863 Py_ssize_t __pyx_t_11;
14864 PyObject *__pyx_t_12 = NULL;
14865 PyObject *__pyx_t_13 = NULL;
14866 Py_ssize_t __pyx_t_14;
14867 Py_ssize_t __pyx_t_15;
14868 Py_ssize_t __pyx_t_16;
14869 Py_ssize_t __pyx_t_17;
14870 Py_ssize_t __pyx_t_18;
14871 Py_ssize_t __pyx_t_19;
14872 Py_ssize_t __pyx_t_20;
14873 PyObject *__pyx_t_21 = NULL;
14875 Py_ssize_t __pyx_t_23;
14876 Py_ssize_t __pyx_t_24;
14877 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
14878 __pyx_pybuffer_mt.pybuffer.buf = NULL;
14879 __pyx_pybuffer_mt.refcount = 0;
14880 __pyx_pybuffernd_mt.data = NULL;
14881 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
14882 __pyx_pybuffer_w.pybuffer.buf = NULL;
14883 __pyx_pybuffer_w.refcount = 0;
14884 __pyx_pybuffernd_w.data = NULL;
14885 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14886 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14887 __pyx_pybuffer_dV.refcount = 0;
14888 __pyx_pybuffernd_dV.data = NULL;
14889 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14890 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
14891 __pyx_pybuffer_weak_residual.refcount = 0;
14892 __pyx_pybuffernd_weak_residual.data = NULL;
14893 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
14895 __Pyx_BufFmt_StackElem __pyx_stack[1];
14896 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14898 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
14900 __Pyx_BufFmt_StackElem __pyx_stack[1];
14901 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14903 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14905 __Pyx_BufFmt_StackElem __pyx_stack[1];
14906 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14908 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14910 __Pyx_BufFmt_StackElem __pyx_stack[1];
14911 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14913 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
14922 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
14923 __pyx_t_2 = __pyx_t_1;
14924 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14925 __pyx_v_eN = __pyx_t_3;
14934 __Pyx_INCREF(__pyx_float_0_0);
14935 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
14944 __Pyx_INCREF(__pyx_float_0_0);
14945 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
14954 __pyx_t_4 = (__pyx_v_mt->dimensions[1]);
14955 __pyx_t_5 = __pyx_t_4;
14956 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14957 __pyx_v_k = __pyx_t_6;
14966 __pyx_t_7 = __pyx_v_eN;
14967 __pyx_t_8 = __pyx_v_k;
14969 if (__pyx_t_7 < 0) {
14970 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
14971 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
14972 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14973 if (__pyx_t_8 < 0) {
14974 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
14975 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
14976 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14977 if (unlikely(__pyx_t_9 != -1)) {
14978 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14979 __PYX_ERR(0, 686, __pyx_L1_error)
14981 __pyx_t_10 = __pyx_v_eN;
14982 __pyx_t_11 = __pyx_v_k;
14984 if (__pyx_t_10 < 0) {
14985 __pyx_t_10 += __pyx_pybuffernd_mt.diminfo[0].shape;
14986 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14987 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_9 = 0;
14988 if (__pyx_t_11 < 0) {
14989 __pyx_t_11 += __pyx_pybuffernd_mt.diminfo[1].shape;
14990 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14991 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_9 = 1;
14992 if (unlikely(__pyx_t_9 != -1)) {
14993 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14994 __PYX_ERR(0, 686, __pyx_L1_error)
14996 __pyx_t_12 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 686, __pyx_L1_error)
14997 __Pyx_GOTREF(__pyx_t_12);
14998 __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 686, __pyx_L1_error)
14999 __Pyx_GOTREF(__pyx_t_13);
15000 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15001 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_13);
15011 __pyx_t_14 = __pyx_v_eN;
15012 __pyx_t_15 = __pyx_v_k;
15014 if (__pyx_t_14 < 0) {
15015 __pyx_t_14 += __pyx_pybuffernd_dV.diminfo[0].shape;
15016 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
15017 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15018 if (__pyx_t_15 < 0) {
15019 __pyx_t_15 += __pyx_pybuffernd_dV.diminfo[1].shape;
15020 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1;
15021 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15022 if (unlikely(__pyx_t_9 != -1)) {
15023 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15024 __PYX_ERR(0, 687, __pyx_L1_error)
15026 __pyx_t_13 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 687, __pyx_L1_error)
15027 __Pyx_GOTREF(__pyx_t_13);
15028 __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 687, __pyx_L1_error)
15029 __Pyx_GOTREF(__pyx_t_12);
15030 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15031 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_12);
15042 __pyx_t_12 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error)
15043 __Pyx_GOTREF(__pyx_t_12);
15044 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_12);
15054 __pyx_t_4 = (__pyx_v_weak_residual->dimensions[1]);
15055 __pyx_t_5 = __pyx_t_4;
15056 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15057 __pyx_v_i = __pyx_t_6;
15066 __pyx_t_16 = __pyx_v_eN;
15067 __pyx_t_17 = __pyx_v_k;
15068 __pyx_t_18 = __pyx_v_i;
15070 if (__pyx_t_16 < 0) {
15071 __pyx_t_16 += __pyx_pybuffernd_w.diminfo[0].shape;
15072 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
15073 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_9 = 0;
15074 if (__pyx_t_17 < 0) {
15075 __pyx_t_17 += __pyx_pybuffernd_w.diminfo[1].shape;
15076 if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 1;
15077 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_9 = 1;
15078 if (__pyx_t_18 < 0) {
15079 __pyx_t_18 += __pyx_pybuffernd_w.diminfo[2].shape;
15080 if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 2;
15081 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_9 = 2;
15082 if (unlikely(__pyx_t_9 != -1)) {
15083 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15084 __PYX_ERR(0, 691, __pyx_L1_error)
15086 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15087 __Pyx_GOTREF(__pyx_t_12);
15088 __pyx_t_13 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 691, __pyx_L1_error)
15089 __Pyx_GOTREF(__pyx_t_13);
15090 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15091 __pyx_t_19 = __pyx_v_eN;
15092 __pyx_t_20 = __pyx_v_k;
15094 if (__pyx_t_19 < 0) {
15095 __pyx_t_19 += __pyx_pybuffernd_dV.diminfo[0].shape;
15096 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
15097 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15098 if (__pyx_t_20 < 0) {
15099 __pyx_t_20 += __pyx_pybuffernd_dV.diminfo[1].shape;
15100 if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
15101 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15102 if (unlikely(__pyx_t_9 != -1)) {
15103 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15104 __PYX_ERR(0, 691, __pyx_L1_error)
15106 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15107 __Pyx_GOTREF(__pyx_t_12);
15108 __pyx_t_21 = PyNumber_Multiply(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 691, __pyx_L1_error)
15109 __Pyx_GOTREF(__pyx_t_21);
15110 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15111 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15112 __pyx_t_22 = __Pyx_PyObject_AsDouble(__pyx_t_21);
if (unlikely(__pyx_t_22 == ((
double)((
double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L1_error)
15113 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15114 __pyx_t_23 = __pyx_v_eN;
15115 __pyx_t_24 = __pyx_v_i;
15117 if (__pyx_t_23 < 0) {
15118 __pyx_t_23 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
15119 if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 0;
15120 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_9 = 0;
15121 if (__pyx_t_24 < 0) {
15122 __pyx_t_24 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
15123 if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 1;
15124 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_9 = 1;
15125 if (unlikely(__pyx_t_9 != -1)) {
15126 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15127 __PYX_ERR(0, 691, __pyx_L1_error)
15129 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_22;
15142 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15145 __Pyx_XDECREF(__pyx_t_12);
15146 __Pyx_XDECREF(__pyx_t_13);
15147 __Pyx_XDECREF(__pyx_t_21);
15148 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15149 __Pyx_PyThreadState_declare
15150 __Pyx_PyThreadState_assign
15151 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15152 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15153 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15154 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15155 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15156 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15157 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15161 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15162 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15163 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15164 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15166 __Pyx_XDECREF(__pyx_v_mt_avg);
15167 __Pyx_XDECREF(__pyx_v_vol);
15168 __Pyx_XGIVEREF(__pyx_r);
15169 __Pyx_RefNannyFinishContext();
15182 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15183 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
15184 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
15185 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15186 PyArrayObject *__pyx_v_dmt = 0;
15187 PyArrayObject *__pyx_v_w = 0;
15188 PyArrayObject *__pyx_v_v = 0;
15189 PyArrayObject *__pyx_v_dV = 0;
15190 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
15191 PyObject *__pyx_r = 0;
15192 __Pyx_RefNannyDeclarations
15193 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
15195 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
15196 PyObject* values[5] = {0,0,0,0,0};
15197 if (unlikely(__pyx_kwds)) {
15198 Py_ssize_t kw_args;
15199 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15200 switch (pos_args) {
15201 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15202 CYTHON_FALLTHROUGH;
15203 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15204 CYTHON_FALLTHROUGH;
15205 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15206 CYTHON_FALLTHROUGH;
15207 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15208 CYTHON_FALLTHROUGH;
15209 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15210 CYTHON_FALLTHROUGH;
15212 default:
goto __pyx_L5_argtuple_error;
15214 kw_args = PyDict_Size(__pyx_kwds);
15215 switch (pos_args) {
15217 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
15218 else goto __pyx_L5_argtuple_error;
15219 CYTHON_FALLTHROUGH;
15221 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
15223 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); __PYX_ERR(0, 692, __pyx_L3_error)
15225 CYTHON_FALLTHROUGH;
15227 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15229 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); __PYX_ERR(0, 692, __pyx_L3_error)
15231 CYTHON_FALLTHROUGH;
15233 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15235 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); __PYX_ERR(0, 692, __pyx_L3_error)
15237 CYTHON_FALLTHROUGH;
15239 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
15241 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); __PYX_ERR(0, 692, __pyx_L3_error)
15244 if (unlikely(kw_args > 0)) {
15245 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
15247 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15248 goto __pyx_L5_argtuple_error;
15250 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15251 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15252 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15253 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15254 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15256 __pyx_v_dmt = ((PyArrayObject *)values[0]);
15257 __pyx_v_w = ((PyArrayObject *)values[1]);
15258 __pyx_v_v = ((PyArrayObject *)values[2]);
15259 __pyx_v_dV = ((PyArrayObject *)values[3]);
15260 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
15262 goto __pyx_L4_argument_unpacking_done;
15263 __pyx_L5_argtuple_error:;
15264 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
15266 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15267 __Pyx_RefNannyFinishContext();
15269 __pyx_L4_argument_unpacking_done:;
15270 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
15271 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
15272 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
15273 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
15274 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
15275 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
15282 __Pyx_RefNannyFinishContext();
15286 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
15291 double __pyx_v_dmtj_avg;
15292 double __pyx_v_vol;
15293 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15294 __Pyx_Buffer __pyx_pybuffer_dV;
15295 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
15296 __Pyx_Buffer __pyx_pybuffer_dmt;
15297 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
15298 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
15299 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15300 __Pyx_Buffer __pyx_pybuffer_v;
15301 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
15302 __Pyx_Buffer __pyx_pybuffer_w;
15303 PyObject *__pyx_r = NULL;
15304 __Pyx_RefNannyDeclarations
15305 npy_intp __pyx_t_1;
15306 npy_intp __pyx_t_2;
15308 npy_intp __pyx_t_4;
15309 npy_intp __pyx_t_5;
15311 Py_ssize_t __pyx_t_7;
15312 Py_ssize_t __pyx_t_8;
15314 npy_intp __pyx_t_10;
15315 npy_intp __pyx_t_11;
15316 npy_intp __pyx_t_12;
15317 npy_intp __pyx_t_13;
15319 Py_ssize_t __pyx_t_15;
15320 Py_ssize_t __pyx_t_16;
15322 Py_ssize_t __pyx_t_18;
15323 Py_ssize_t __pyx_t_19;
15324 Py_ssize_t __pyx_t_20;
15325 Py_ssize_t __pyx_t_21;
15326 Py_ssize_t __pyx_t_22;
15327 Py_ssize_t __pyx_t_23;
15328 Py_ssize_t __pyx_t_24;
15329 Py_ssize_t __pyx_t_25;
15330 Py_ssize_t __pyx_t_26;
15331 Py_ssize_t __pyx_t_27;
15332 Py_ssize_t __pyx_t_28;
15333 Py_ssize_t __pyx_t_29;
15334 Py_ssize_t __pyx_t_30;
15335 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
15336 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
15337 __pyx_pybuffer_dmt.refcount = 0;
15338 __pyx_pybuffernd_dmt.data = NULL;
15339 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
15340 __pyx_pybuffer_w.pybuffer.buf = NULL;
15341 __pyx_pybuffer_w.refcount = 0;
15342 __pyx_pybuffernd_w.data = NULL;
15343 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
15344 __pyx_pybuffer_v.pybuffer.buf = NULL;
15345 __pyx_pybuffer_v.refcount = 0;
15346 __pyx_pybuffernd_v.data = NULL;
15347 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15348 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15349 __pyx_pybuffer_dV.refcount = 0;
15350 __pyx_pybuffernd_dV.data = NULL;
15351 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15352 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
15353 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
15354 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
15355 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
15357 __Pyx_BufFmt_StackElem __pyx_stack[1];
15358 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15360 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
15362 __Pyx_BufFmt_StackElem __pyx_stack[1];
15363 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15365 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
15367 __Pyx_BufFmt_StackElem __pyx_stack[1];
15368 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15370 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
15372 __Pyx_BufFmt_StackElem __pyx_stack[1];
15373 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15375 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15377 __Pyx_BufFmt_StackElem __pyx_stack[1];
15378 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15380 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
15389 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
15390 __pyx_t_2 = __pyx_t_1;
15391 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15392 __pyx_v_eN = __pyx_t_3;
15410 __pyx_t_4 = (__pyx_v_dmt->dimensions[1]);
15411 __pyx_t_5 = __pyx_t_4;
15412 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15413 __pyx_v_k = __pyx_t_6;
15422 __pyx_t_7 = __pyx_v_eN;
15423 __pyx_t_8 = __pyx_v_k;
15425 if (__pyx_t_7 < 0) {
15426 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
15427 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
15428 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15429 if (__pyx_t_8 < 0) {
15430 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
15431 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15432 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15433 if (unlikely(__pyx_t_9 != -1)) {
15434 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15435 __PYX_ERR(0, 705, __pyx_L1_error)
15437 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
15447 __pyx_t_4 = (__pyx_v_w->dimensions[2]);
15448 __pyx_t_5 = __pyx_t_4;
15449 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15450 __pyx_v_i = __pyx_t_6;
15459 __pyx_t_10 = (__pyx_v_v->dimensions[2]);
15460 __pyx_t_11 = __pyx_t_10;
15461 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
15462 __pyx_v_j = __pyx_t_9;
15471 __pyx_v_dmtj_avg = 0.0;
15480 __pyx_t_12 = (__pyx_v_dmt->dimensions[1]);
15481 __pyx_t_13 = __pyx_t_12;
15482 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
15483 __pyx_v_k = __pyx_t_14;
15492 __pyx_t_15 = __pyx_v_eN;
15493 __pyx_t_16 = __pyx_v_k;
15495 if (__pyx_t_15 < 0) {
15496 __pyx_t_15 += __pyx_pybuffernd_dV.diminfo[0].shape;
15497 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
15498 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_17 = 0;
15499 if (__pyx_t_16 < 0) {
15500 __pyx_t_16 += __pyx_pybuffernd_dV.diminfo[1].shape;
15501 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
15502 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_17 = 1;
15503 if (unlikely(__pyx_t_17 != -1)) {
15504 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15505 __PYX_ERR(0, 710, __pyx_L1_error)
15507 __pyx_t_18 = __pyx_v_eN;
15508 __pyx_t_19 = __pyx_v_k;
15510 if (__pyx_t_18 < 0) {
15511 __pyx_t_18 += __pyx_pybuffernd_dmt.diminfo[0].shape;
15512 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15513 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_17 = 0;
15514 if (__pyx_t_19 < 0) {
15515 __pyx_t_19 += __pyx_pybuffernd_dmt.diminfo[1].shape;
15516 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15517 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_17 = 1;
15518 if (unlikely(__pyx_t_17 != -1)) {
15519 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15520 __PYX_ERR(0, 710, __pyx_L1_error)
15522 __pyx_t_20 = __pyx_v_eN;
15523 __pyx_t_21 = __pyx_v_k;
15524 __pyx_t_22 = __pyx_v_j;
15526 if (__pyx_t_20 < 0) {
15527 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[0].shape;
15528 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 0;
15529 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15530 if (__pyx_t_21 < 0) {
15531 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[1].shape;
15532 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 1;
15533 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15534 if (__pyx_t_22 < 0) {
15535 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[2].shape;
15536 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 2;
15537 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15538 if (unlikely(__pyx_t_17 != -1)) {
15539 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15540 __PYX_ERR(0, 710, __pyx_L1_error)
15542 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[2].strides))));
15552 if (unlikely(__pyx_v_vol == 0)) {
15553 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15554 __PYX_ERR(0, 711, __pyx_L1_error)
15556 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
15565 __pyx_t_23 = __pyx_v_eN;
15566 __pyx_t_24 = __pyx_v_k;
15567 __pyx_t_25 = __pyx_v_i;
15569 if (__pyx_t_23 < 0) {
15570 __pyx_t_23 += __pyx_pybuffernd_w.diminfo[0].shape;
15571 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
15572 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_14 = 0;
15573 if (__pyx_t_24 < 0) {
15574 __pyx_t_24 += __pyx_pybuffernd_w.diminfo[1].shape;
15575 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
15576 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_14 = 1;
15577 if (__pyx_t_25 < 0) {
15578 __pyx_t_25 += __pyx_pybuffernd_w.diminfo[2].shape;
15579 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
15580 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_14 = 2;
15581 if (unlikely(__pyx_t_14 != -1)) {
15582 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15583 __PYX_ERR(0, 712, __pyx_L1_error)
15585 __pyx_t_26 = __pyx_v_eN;
15586 __pyx_t_27 = __pyx_v_k;
15588 if (__pyx_t_26 < 0) {
15589 __pyx_t_26 += __pyx_pybuffernd_dV.diminfo[0].shape;
15590 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0;
15591 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_14 = 0;
15592 if (__pyx_t_27 < 0) {
15593 __pyx_t_27 += __pyx_pybuffernd_dV.diminfo[1].shape;
15594 if (unlikely(__pyx_t_27 < 0)) __pyx_t_14 = 1;
15595 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_14 = 1;
15596 if (unlikely(__pyx_t_14 != -1)) {
15597 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15598 __PYX_ERR(0, 712, __pyx_L1_error)
15600 __pyx_t_28 = __pyx_v_eN;
15601 __pyx_t_29 = __pyx_v_i;
15602 __pyx_t_30 = __pyx_v_j;
15604 if (__pyx_t_28 < 0) {
15605 __pyx_t_28 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
15606 if (unlikely(__pyx_t_28 < 0)) __pyx_t_14 = 0;
15607 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_14 = 0;
15608 if (__pyx_t_29 < 0) {
15609 __pyx_t_29 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
15610 if (unlikely(__pyx_t_29 < 0)) __pyx_t_14 = 1;
15611 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_14 = 1;
15612 if (__pyx_t_30 < 0) {
15613 __pyx_t_30 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
15614 if (unlikely(__pyx_t_30 < 0)) __pyx_t_14 = 2;
15615 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_14 = 2;
15616 if (unlikely(__pyx_t_14 != -1)) {
15617 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15618 __PYX_ERR(0, 712, __pyx_L1_error)
15620 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_dV.diminfo[1].strides)));
15634 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15637 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15638 __Pyx_PyThreadState_declare
15639 __Pyx_PyThreadState_assign
15640 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15644 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15645 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15646 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15647 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15651 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15657 __Pyx_XGIVEREF(__pyx_r);
15658 __Pyx_RefNannyFinishContext();
15671 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15672 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
15673 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15674 PyArrayObject *__pyx_v_v = 0;
15675 PyArrayObject *__pyx_v_n = 0;
15676 PyArrayObject *__pyx_v_dS = 0;
15677 PyArrayObject *__pyx_v_flux = 0;
15678 PyObject *__pyx_r = 0;
15679 __Pyx_RefNannyDeclarations
15680 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
15682 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
15683 PyObject* values[4] = {0,0,0,0};
15684 if (unlikely(__pyx_kwds)) {
15685 Py_ssize_t kw_args;
15686 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15687 switch (pos_args) {
15688 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15689 CYTHON_FALLTHROUGH;
15690 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15691 CYTHON_FALLTHROUGH;
15692 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15693 CYTHON_FALLTHROUGH;
15694 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15695 CYTHON_FALLTHROUGH;
15697 default:
goto __pyx_L5_argtuple_error;
15699 kw_args = PyDict_Size(__pyx_kwds);
15700 switch (pos_args) {
15702 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15703 else goto __pyx_L5_argtuple_error;
15704 CYTHON_FALLTHROUGH;
15706 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
15708 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); __PYX_ERR(0, 717, __pyx_L3_error)
15710 CYTHON_FALLTHROUGH;
15712 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
15714 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); __PYX_ERR(0, 717, __pyx_L3_error)
15716 CYTHON_FALLTHROUGH;
15718 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
15720 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); __PYX_ERR(0, 717, __pyx_L3_error)
15723 if (unlikely(kw_args > 0)) {
15724 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
15726 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15727 goto __pyx_L5_argtuple_error;
15729 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15730 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15731 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15732 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15734 __pyx_v_v = ((PyArrayObject *)values[0]);
15735 __pyx_v_n = ((PyArrayObject *)values[1]);
15736 __pyx_v_dS = ((PyArrayObject *)values[2]);
15737 __pyx_v_flux = ((PyArrayObject *)values[3]);
15739 goto __pyx_L4_argument_unpacking_done;
15740 __pyx_L5_argtuple_error:;
15741 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 717, __pyx_L3_error)
15743 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15744 __Pyx_RefNannyFinishContext();
15746 __pyx_L4_argument_unpacking_done:;
15747 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
15748 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
15749 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
15750 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
15751 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
15758 __Pyx_RefNannyFinishContext();
15762 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
15766 double __pyx_v_integral;
15767 npy_intp __pyx_v_I;
15768 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
15769 __Pyx_Buffer __pyx_pybuffer_dS;
15770 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
15771 __Pyx_Buffer __pyx_pybuffer_flux;
15772 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
15773 __Pyx_Buffer __pyx_pybuffer_n;
15774 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15775 __Pyx_Buffer __pyx_pybuffer_v;
15776 PyObject *__pyx_r = NULL;
15777 __Pyx_RefNannyDeclarations
15778 npy_intp __pyx_t_1;
15779 npy_intp __pyx_t_2;
15781 npy_intp __pyx_t_4;
15782 npy_intp __pyx_t_5;
15784 npy_intp __pyx_t_7;
15785 npy_intp __pyx_t_8;
15787 npy_intp __pyx_t_10;
15788 npy_intp __pyx_t_11;
15789 npy_intp __pyx_t_12;
15790 Py_ssize_t __pyx_t_13;
15791 Py_ssize_t __pyx_t_14;
15792 Py_ssize_t __pyx_t_15;
15793 Py_ssize_t __pyx_t_16;
15795 Py_ssize_t __pyx_t_18;
15796 Py_ssize_t __pyx_t_19;
15797 Py_ssize_t __pyx_t_20;
15798 Py_ssize_t __pyx_t_21;
15799 Py_ssize_t __pyx_t_22;
15800 Py_ssize_t __pyx_t_23;
15801 Py_ssize_t __pyx_t_24;
15802 Py_ssize_t __pyx_t_25;
15803 Py_ssize_t __pyx_t_26;
15804 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
15805 __pyx_pybuffer_v.pybuffer.buf = NULL;
15806 __pyx_pybuffer_v.refcount = 0;
15807 __pyx_pybuffernd_v.data = NULL;
15808 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15809 __pyx_pybuffer_n.pybuffer.buf = NULL;
15810 __pyx_pybuffer_n.refcount = 0;
15811 __pyx_pybuffernd_n.data = NULL;
15812 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
15813 __pyx_pybuffer_dS.pybuffer.buf = NULL;
15814 __pyx_pybuffer_dS.refcount = 0;
15815 __pyx_pybuffernd_dS.data = NULL;
15816 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
15817 __pyx_pybuffer_flux.pybuffer.buf = NULL;
15818 __pyx_pybuffer_flux.refcount = 0;
15819 __pyx_pybuffernd_flux.data = NULL;
15820 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
15822 __Pyx_BufFmt_StackElem __pyx_stack[1];
15823 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15825 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
15827 __Pyx_BufFmt_StackElem __pyx_stack[1];
15828 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15830 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
15832 __Pyx_BufFmt_StackElem __pyx_stack[1];
15833 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15835 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
15837 __Pyx_BufFmt_StackElem __pyx_stack[1];
15838 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15840 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
15849 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
15850 __pyx_t_2 = __pyx_t_1;
15851 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15852 __pyx_v_eN = __pyx_t_3;
15861 __pyx_t_4 = (__pyx_v_n->dimensions[1]);
15862 __pyx_t_5 = __pyx_t_4;
15863 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15864 __pyx_v_ebN = __pyx_t_6;
15873 __pyx_v_integral = 0.0;
15882 __pyx_t_7 = (__pyx_v_n->dimensions[2]);
15883 __pyx_t_8 = __pyx_t_7;
15884 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
15885 __pyx_v_kb = __pyx_t_9;
15894 __pyx_t_10 = (__pyx_v_n->dimensions[3]);
15895 __pyx_t_11 = __pyx_t_10;
15896 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
15897 __pyx_v_I = __pyx_t_12;
15906 __pyx_t_13 = __pyx_v_eN;
15907 __pyx_t_14 = __pyx_v_ebN;
15908 __pyx_t_15 = __pyx_v_kb;
15909 __pyx_t_16 = __pyx_v_I;
15911 if (__pyx_t_13 < 0) {
15912 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
15913 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
15914 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15915 if (__pyx_t_14 < 0) {
15916 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
15917 if (unlikely(__pyx_t_14 < 0)) __pyx_t_17 = 1;
15918 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15919 if (__pyx_t_15 < 0) {
15920 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
15921 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 2;
15922 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15923 if (__pyx_t_16 < 0) {
15924 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
15925 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 3;
15926 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_17 = 3;
15927 if (unlikely(__pyx_t_17 != -1)) {
15928 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15929 __PYX_ERR(0, 729, __pyx_L1_error)
15931 __pyx_t_18 = __pyx_v_eN;
15932 __pyx_t_19 = __pyx_v_ebN;
15933 __pyx_t_20 = __pyx_v_kb;
15934 __pyx_t_21 = __pyx_v_I;
15936 if (__pyx_t_18 < 0) {
15937 __pyx_t_18 += __pyx_pybuffernd_n.diminfo[0].shape;
15938 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15939 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
15940 if (__pyx_t_19 < 0) {
15941 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[1].shape;
15942 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15943 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_17 = 1;
15944 if (__pyx_t_20 < 0) {
15945 __pyx_t_20 += __pyx_pybuffernd_n.diminfo[2].shape;
15946 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
15947 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_17 = 2;
15948 if (__pyx_t_21 < 0) {
15949 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[3].shape;
15950 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 3;
15951 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_17 = 3;
15952 if (unlikely(__pyx_t_17 != -1)) {
15953 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15954 __PYX_ERR(0, 729, __pyx_L1_error)
15956 __pyx_t_22 = __pyx_v_eN;
15957 __pyx_t_23 = __pyx_v_ebN;
15958 __pyx_t_24 = __pyx_v_kb;
15960 if (__pyx_t_22 < 0) {
15961 __pyx_t_22 += __pyx_pybuffernd_dS.diminfo[0].shape;
15962 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
15963 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_17 = 0;
15964 if (__pyx_t_23 < 0) {
15965 __pyx_t_23 += __pyx_pybuffernd_dS.diminfo[1].shape;
15966 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 1;
15967 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_17 = 1;
15968 if (__pyx_t_24 < 0) {
15969 __pyx_t_24 += __pyx_pybuffernd_dS.diminfo[2].shape;
15970 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 2;
15971 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_17 = 2;
15972 if (unlikely(__pyx_t_17 != -1)) {
15973 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15974 __PYX_ERR(0, 729, __pyx_L1_error)
15976 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_dS.diminfo[2].strides))));
15987 __pyx_t_25 = __pyx_v_eN;
15988 __pyx_t_26 = __pyx_v_ebN;
15990 if (__pyx_t_25 < 0) {
15991 __pyx_t_25 += __pyx_pybuffernd_flux.diminfo[0].shape;
15992 if (unlikely(__pyx_t_25 < 0)) __pyx_t_9 = 0;
15993 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_9 = 0;
15994 if (__pyx_t_26 < 0) {
15995 __pyx_t_26 += __pyx_pybuffernd_flux.diminfo[1].shape;
15996 if (unlikely(__pyx_t_26 < 0)) __pyx_t_9 = 1;
15997 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_9 = 1;
15998 if (unlikely(__pyx_t_9 != -1)) {
15999 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16000 __PYX_ERR(0, 730, __pyx_L1_error)
16002 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
16015 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16018 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16019 __Pyx_PyThreadState_declare
16020 __Pyx_PyThreadState_assign
16021 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16022 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
16023 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
16024 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
16025 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16026 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16027 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
16031 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
16032 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
16033 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
16034 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16036 __Pyx_XGIVEREF(__pyx_r);
16037 __Pyx_RefNannyFinishContext();
16050 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16051 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16052 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
16053 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16054 PyArrayObject *__pyx_v_df = 0;
16055 PyArrayObject *__pyx_v_characteristic_velocity = 0;
16056 PyArrayObject *__pyx_v_dm = 0;
16057 PyArrayObject *__pyx_v_dV = 0;
16058 PyObject *__pyx_r = 0;
16059 __Pyx_RefNannyDeclarations
16060 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
16062 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16063 PyObject* values[4] = {0,0,0,0};
16064 if (unlikely(__pyx_kwds)) {
16065 Py_ssize_t kw_args;
16066 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16067 switch (pos_args) {
16068 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16069 CYTHON_FALLTHROUGH;
16070 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16071 CYTHON_FALLTHROUGH;
16072 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16073 CYTHON_FALLTHROUGH;
16074 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16075 CYTHON_FALLTHROUGH;
16077 default:
goto __pyx_L5_argtuple_error;
16079 kw_args = PyDict_Size(__pyx_kwds);
16080 switch (pos_args) {
16082 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
16083 else goto __pyx_L5_argtuple_error;
16084 CYTHON_FALLTHROUGH;
16086 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
16088 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); __PYX_ERR(0, 732, __pyx_L3_error)
16090 CYTHON_FALLTHROUGH;
16092 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16094 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); __PYX_ERR(0, 732, __pyx_L3_error)
16096 CYTHON_FALLTHROUGH;
16098 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16100 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); __PYX_ERR(0, 732, __pyx_L3_error)
16103 if (unlikely(kw_args > 0)) {
16104 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) __PYX_ERR(0, 732, __pyx_L3_error)
16106 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
16107 goto __pyx_L5_argtuple_error;
16109 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16110 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16111 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16112 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16114 __pyx_v_df = ((PyArrayObject *)values[0]);
16115 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
16116 __pyx_v_dm = ((PyArrayObject *)values[2]);
16117 __pyx_v_dV = ((PyArrayObject *)values[3]);
16119 goto __pyx_L4_argument_unpacking_done;
16120 __pyx_L5_argtuple_error:;
16121 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error)
16123 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16124 __Pyx_RefNannyFinishContext();
16126 __pyx_L4_argument_unpacking_done:;
16127 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
16128 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
16129 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
16130 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
16131 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
16138 __Pyx_RefNannyFinishContext();
16142 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16146 double __pyx_v_omega_e;
16147 double __pyx_v_vol_e;
16148 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
16149 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
16150 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16151 __Pyx_Buffer __pyx_pybuffer_dV;
16152 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
16153 __Pyx_Buffer __pyx_pybuffer_df;
16154 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16155 __Pyx_Buffer __pyx_pybuffer_dm;
16156 PyObject *__pyx_r = NULL;
16157 __Pyx_RefNannyDeclarations
16158 npy_intp __pyx_t_1;
16159 npy_intp __pyx_t_2;
16161 npy_intp __pyx_t_4;
16162 npy_intp __pyx_t_5;
16164 Py_ssize_t __pyx_t_7;
16165 Py_ssize_t __pyx_t_8;
16167 Py_ssize_t __pyx_t_10;
16168 Py_ssize_t __pyx_t_11;
16169 Py_ssize_t __pyx_t_12;
16170 Py_ssize_t __pyx_t_13;
16171 npy_intp __pyx_t_14;
16172 npy_intp __pyx_t_15;
16173 Py_ssize_t __pyx_t_16;
16174 Py_ssize_t __pyx_t_17;
16175 Py_ssize_t __pyx_t_18;
16177 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
16179 Py_ssize_t __pyx_t_22;
16180 Py_ssize_t __pyx_t_23;
16181 Py_ssize_t __pyx_t_24;
16182 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
16183 __pyx_pybuffer_df.pybuffer.buf = NULL;
16184 __pyx_pybuffer_df.refcount = 0;
16185 __pyx_pybuffernd_df.data = NULL;
16186 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
16187 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
16188 __pyx_pybuffer_characteristic_velocity.refcount = 0;
16189 __pyx_pybuffernd_characteristic_velocity.data = NULL;
16190 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
16191 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16192 __pyx_pybuffer_dm.refcount = 0;
16193 __pyx_pybuffernd_dm.data = NULL;
16194 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16195 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16196 __pyx_pybuffer_dV.refcount = 0;
16197 __pyx_pybuffernd_dV.data = NULL;
16198 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16200 __Pyx_BufFmt_StackElem __pyx_stack[1];
16201 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16203 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
16205 __Pyx_BufFmt_StackElem __pyx_stack[1];
16206 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16208 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
16210 __Pyx_BufFmt_StackElem __pyx_stack[1];
16211 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16213 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16215 __Pyx_BufFmt_StackElem __pyx_stack[1];
16216 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16218 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16227 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16228 __pyx_t_2 = __pyx_t_1;
16229 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16230 __pyx_v_eN = __pyx_t_3;
16239 __pyx_v_omega_e = 0.0;
16248 __pyx_v_vol_e = 0.0;
16257 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16258 __pyx_t_5 = __pyx_t_4;
16259 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16260 __pyx_v_k = __pyx_t_6;
16269 __pyx_t_7 = __pyx_v_eN;
16270 __pyx_t_8 = __pyx_v_k;
16272 if (__pyx_t_7 < 0) {
16273 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16274 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16275 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16276 if (__pyx_t_8 < 0) {
16277 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16278 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16279 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16280 if (unlikely(__pyx_t_9 != -1)) {
16281 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16282 __PYX_ERR(0, 747, __pyx_L1_error)
16284 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16293 __pyx_t_10 = __pyx_v_eN;
16294 __pyx_t_11 = __pyx_v_k;
16296 if (__pyx_t_10 < 0) {
16297 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[0].shape;
16298 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16299 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16300 if (__pyx_t_11 < 0) {
16301 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
16302 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16303 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16304 if (unlikely(__pyx_t_9 != -1)) {
16305 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16306 __PYX_ERR(0, 748, __pyx_L1_error)
16308 __pyx_t_12 = __pyx_v_eN;
16309 __pyx_t_13 = __pyx_v_k;
16311 if (__pyx_t_12 < 0) {
16312 __pyx_t_12 += __pyx_pybuffernd_dm.diminfo[0].shape;
16313 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
16314 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16315 if (__pyx_t_13 < 0) {
16316 __pyx_t_13 += __pyx_pybuffernd_dm.diminfo[1].shape;
16317 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
16318 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16319 if (unlikely(__pyx_t_9 != -1)) {
16320 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16321 __PYX_ERR(0, 748, __pyx_L1_error)
16323 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_dm.diminfo[1].strides))));
16333 __pyx_t_4 = (__pyx_v_df->dimensions[1]);
16334 __pyx_t_5 = __pyx_t_4;
16335 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16336 __pyx_v_k = __pyx_t_6;
16345 __pyx_t_14 = (__pyx_v_df->dimensions[2]);
16346 __pyx_t_15 = __pyx_t_14;
16347 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_15; __pyx_t_9+=1) {
16348 __pyx_v_I = __pyx_t_9;
16357 __pyx_t_16 = __pyx_v_eN;
16358 __pyx_t_17 = __pyx_v_k;
16359 __pyx_t_18 = __pyx_v_I;
16361 if (__pyx_t_16 < 0) {
16362 __pyx_t_16 += __pyx_pybuffernd_df.diminfo[0].shape;
16363 if (unlikely(__pyx_t_16 < 0)) __pyx_t_19 = 0;
16364 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_19 = 0;
16365 if (__pyx_t_17 < 0) {
16366 __pyx_t_17 += __pyx_pybuffernd_df.diminfo[1].shape;
16367 if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 1;
16368 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_19 = 1;
16369 if (__pyx_t_18 < 0) {
16370 __pyx_t_18 += __pyx_pybuffernd_df.diminfo[2].shape;
16371 if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 2;
16372 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_19 = 2;
16373 if (unlikely(__pyx_t_19 != -1)) {
16374 __Pyx_RaiseBufferIndexError(__pyx_t_19);
16375 __PYX_ERR(0, 751, __pyx_L1_error)
16377 __pyx_t_20 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
16378 __pyx_t_21 = (__pyx_v_omega_e + 1.0e-12);
16379 if (unlikely(__pyx_t_21 == 0)) {
16380 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16381 __PYX_ERR(0, 751, __pyx_L1_error)
16383 __pyx_t_22 = __pyx_v_eN;
16384 __pyx_t_23 = __pyx_v_k;
16385 __pyx_t_24 = __pyx_v_I;
16387 if (__pyx_t_22 < 0) {
16388 __pyx_t_22 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
16389 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 0;
16390 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_19 = 0;
16391 if (__pyx_t_23 < 0) {
16392 __pyx_t_23 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
16393 if (unlikely(__pyx_t_23 < 0)) __pyx_t_19 = 1;
16394 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_19 = 1;
16395 if (__pyx_t_24 < 0) {
16396 __pyx_t_24 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
16397 if (unlikely(__pyx_t_24 < 0)) __pyx_t_19 = 2;
16398 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_19 = 2;
16399 if (unlikely(__pyx_t_19 != -1)) {
16400 __Pyx_RaiseBufferIndexError(__pyx_t_19);
16401 __PYX_ERR(0, 751, __pyx_L1_error)
16403 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_20 / __pyx_t_21);
16417 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16420 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16421 __Pyx_PyThreadState_declare
16422 __Pyx_PyThreadState_assign
16423 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16424 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16425 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16426 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16427 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16428 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16429 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16433 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16434 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16435 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16436 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16438 __Pyx_XGIVEREF(__pyx_r);
16439 __Pyx_RefNannyFinishContext();
16452 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16453 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16454 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
16455 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16456 PyArrayObject *__pyx_v_df_dofs = 0;
16457 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
16458 PyArrayObject *__pyx_v_l2g = 0;
16459 PyArrayObject *__pyx_v_dm = 0;
16460 PyArrayObject *__pyx_v_dV = 0;
16461 PyObject *__pyx_r = 0;
16462 __Pyx_RefNannyDeclarations
16463 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
16465 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16466 PyObject* values[5] = {0,0,0,0,0};
16467 if (unlikely(__pyx_kwds)) {
16468 Py_ssize_t kw_args;
16469 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16470 switch (pos_args) {
16471 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16472 CYTHON_FALLTHROUGH;
16473 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16474 CYTHON_FALLTHROUGH;
16475 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16476 CYTHON_FALLTHROUGH;
16477 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16478 CYTHON_FALLTHROUGH;
16479 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16480 CYTHON_FALLTHROUGH;
16482 default:
goto __pyx_L5_argtuple_error;
16484 kw_args = PyDict_Size(__pyx_kwds);
16485 switch (pos_args) {
16487 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
16488 else goto __pyx_L5_argtuple_error;
16489 CYTHON_FALLTHROUGH;
16491 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
16493 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); __PYX_ERR(0, 753, __pyx_L3_error)
16495 CYTHON_FALLTHROUGH;
16497 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
16499 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); __PYX_ERR(0, 753, __pyx_L3_error)
16501 CYTHON_FALLTHROUGH;
16503 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16505 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); __PYX_ERR(0, 753, __pyx_L3_error)
16507 CYTHON_FALLTHROUGH;
16509 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16511 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); __PYX_ERR(0, 753, __pyx_L3_error)
16514 if (unlikely(kw_args > 0)) {
16515 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) __PYX_ERR(0, 753, __pyx_L3_error)
16517 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16518 goto __pyx_L5_argtuple_error;
16520 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16521 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16522 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16523 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16524 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16526 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
16527 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
16528 __pyx_v_l2g = ((PyArrayObject *)values[2]);
16529 __pyx_v_dm = ((PyArrayObject *)values[3]);
16530 __pyx_v_dV = ((PyArrayObject *)values[4]);
16532 goto __pyx_L4_argument_unpacking_done;
16533 __pyx_L5_argtuple_error:;
16534 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
16536 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16537 __Pyx_RefNannyFinishContext();
16539 __pyx_L4_argument_unpacking_done:;
16540 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
16541 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
16542 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
16543 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
16544 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
16545 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
16552 __Pyx_RefNannyFinishContext();
16556 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16561 double __pyx_v_omega_e;
16562 double __pyx_v_vol_e;
16563 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
16564 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
16565 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16566 __Pyx_Buffer __pyx_pybuffer_dV;
16567 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
16568 __Pyx_Buffer __pyx_pybuffer_df_dofs;
16569 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16570 __Pyx_Buffer __pyx_pybuffer_dm;
16571 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
16572 __Pyx_Buffer __pyx_pybuffer_l2g;
16573 PyObject *__pyx_r = NULL;
16574 __Pyx_RefNannyDeclarations
16575 npy_intp __pyx_t_1;
16576 npy_intp __pyx_t_2;
16578 npy_intp __pyx_t_4;
16579 npy_intp __pyx_t_5;
16581 Py_ssize_t __pyx_t_7;
16582 Py_ssize_t __pyx_t_8;
16584 Py_ssize_t __pyx_t_10;
16585 Py_ssize_t __pyx_t_11;
16586 Py_ssize_t __pyx_t_12;
16587 Py_ssize_t __pyx_t_13;
16588 Py_ssize_t __pyx_t_14;
16589 Py_ssize_t __pyx_t_15;
16590 Py_ssize_t __pyx_t_16;
16591 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
16593 Py_ssize_t __pyx_t_19;
16594 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
16595 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
16596 __pyx_pybuffer_df_dofs.refcount = 0;
16597 __pyx_pybuffernd_df_dofs.data = NULL;
16598 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
16599 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
16600 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
16601 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
16602 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
16603 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
16604 __pyx_pybuffer_l2g.refcount = 0;
16605 __pyx_pybuffernd_l2g.data = NULL;
16606 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
16607 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16608 __pyx_pybuffer_dm.refcount = 0;
16609 __pyx_pybuffernd_dm.data = NULL;
16610 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16611 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16612 __pyx_pybuffer_dV.refcount = 0;
16613 __pyx_pybuffernd_dV.data = NULL;
16614 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16616 __Pyx_BufFmt_StackElem __pyx_stack[1];
16617 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16619 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
16621 __Pyx_BufFmt_StackElem __pyx_stack[1];
16622 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16624 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
16626 __Pyx_BufFmt_StackElem __pyx_stack[1];
16627 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16629 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
16631 __Pyx_BufFmt_StackElem __pyx_stack[1];
16632 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16634 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16636 __Pyx_BufFmt_StackElem __pyx_stack[1];
16637 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16639 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16648 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16649 __pyx_t_2 = __pyx_t_1;
16650 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16651 __pyx_v_eN = __pyx_t_3;
16660 __pyx_v_omega_e = 0.0;
16669 __pyx_v_vol_e = 0.0;
16678 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16679 __pyx_t_5 = __pyx_t_4;
16680 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16681 __pyx_v_k = __pyx_t_6;
16690 __pyx_t_7 = __pyx_v_eN;
16691 __pyx_t_8 = __pyx_v_k;
16693 if (__pyx_t_7 < 0) {
16694 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16695 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16696 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16697 if (__pyx_t_8 < 0) {
16698 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16699 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16700 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16701 if (unlikely(__pyx_t_9 != -1)) {
16702 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16703 __PYX_ERR(0, 769, __pyx_L1_error)
16705 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16714 __pyx_t_10 = __pyx_v_eN;
16715 __pyx_t_11 = __pyx_v_k;
16717 if (__pyx_t_10 < 0) {
16718 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[0].shape;
16719 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16720 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16721 if (__pyx_t_11 < 0) {
16722 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
16723 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16724 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16725 if (unlikely(__pyx_t_9 != -1)) {
16726 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16727 __PYX_ERR(0, 770, __pyx_L1_error)
16729 __pyx_t_12 = __pyx_v_eN;
16730 __pyx_t_13 = __pyx_v_k;
16732 if (__pyx_t_12 < 0) {
16733 __pyx_t_12 += __pyx_pybuffernd_dm.diminfo[0].shape;
16734 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
16735 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16736 if (__pyx_t_13 < 0) {
16737 __pyx_t_13 += __pyx_pybuffernd_dm.diminfo[1].shape;
16738 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 1;
16739 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16740 if (unlikely(__pyx_t_9 != -1)) {
16741 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16742 __PYX_ERR(0, 770, __pyx_L1_error)
16744 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_dm.diminfo[1].strides))));
16754 __pyx_t_4 = (__pyx_v_l2g->dimensions[1]);
16755 __pyx_t_5 = __pyx_t_4;
16756 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16757 __pyx_v_j = __pyx_t_6;
16766 __pyx_t_14 = __pyx_v_eN;
16767 __pyx_t_15 = __pyx_v_j;
16769 if (__pyx_t_14 < 0) {
16770 __pyx_t_14 += __pyx_pybuffernd_l2g.diminfo[0].shape;
16771 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
16772 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_9 = 0;
16773 if (__pyx_t_15 < 0) {
16774 __pyx_t_15 += __pyx_pybuffernd_l2g.diminfo[1].shape;
16775 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1;
16776 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_9 = 1;
16777 if (unlikely(__pyx_t_9 != -1)) {
16778 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16779 __PYX_ERR(0, 772, __pyx_L1_error)
16781 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_l2g.diminfo[1].strides));
16790 __pyx_t_16 = __pyx_v_J;
16792 if (__pyx_t_16 < 0) {
16793 __pyx_t_16 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
16794 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
16795 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16796 if (unlikely(__pyx_t_9 != -1)) {
16797 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16798 __PYX_ERR(0, 773, __pyx_L1_error)
16800 __pyx_t_17 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
16801 __pyx_t_18 = (__pyx_v_omega_e + 1.0e-12);
16802 if (unlikely(__pyx_t_18 == 0)) {
16803 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16804 __PYX_ERR(0, 773, __pyx_L1_error)
16806 __pyx_t_19 = __pyx_v_J;
16808 if (__pyx_t_19 < 0) {
16809 __pyx_t_19 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
16810 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
16811 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16812 if (unlikely(__pyx_t_9 != -1)) {
16813 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16814 __PYX_ERR(0, 773, __pyx_L1_error)
16816 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_17 / __pyx_t_18);
16829 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16832 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16833 __Pyx_PyThreadState_declare
16834 __Pyx_PyThreadState_assign
16835 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16836 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16837 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16838 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16839 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16840 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16841 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16842 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16846 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16847 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16848 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16849 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16850 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16852 __Pyx_XGIVEREF(__pyx_r);
16853 __Pyx_RefNannyFinishContext();
16866 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16867 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
16868 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16869 int __pyx_v_transient;
16871 double __pyx_v_tForReversal;
16872 double __pyx_v_clock;
16875 PyArrayObject *__pyx_v_x = 0;
16876 PyArrayObject *__pyx_v_v = 0;
16877 double __pyx_v_zvelocity;
16878 PyObject *__pyx_r = 0;
16879 __Pyx_RefNannyDeclarations
16880 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
16882 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16883 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16884 if (unlikely(__pyx_kwds)) {
16885 Py_ssize_t kw_args;
16886 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16887 switch (pos_args) {
16888 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16889 CYTHON_FALLTHROUGH;
16890 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16891 CYTHON_FALLTHROUGH;
16892 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16893 CYTHON_FALLTHROUGH;
16894 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16895 CYTHON_FALLTHROUGH;
16896 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16897 CYTHON_FALLTHROUGH;
16898 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16899 CYTHON_FALLTHROUGH;
16900 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16901 CYTHON_FALLTHROUGH;
16902 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16903 CYTHON_FALLTHROUGH;
16904 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16905 CYTHON_FALLTHROUGH;
16907 default:
goto __pyx_L5_argtuple_error;
16909 kw_args = PyDict_Size(__pyx_kwds);
16910 switch (pos_args) {
16912 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16913 else goto __pyx_L5_argtuple_error;
16914 CYTHON_FALLTHROUGH;
16916 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16918 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); __PYX_ERR(0, 776, __pyx_L3_error)
16920 CYTHON_FALLTHROUGH;
16922 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16924 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); __PYX_ERR(0, 776, __pyx_L3_error)
16926 CYTHON_FALLTHROUGH;
16928 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16930 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); __PYX_ERR(0, 776, __pyx_L3_error)
16932 CYTHON_FALLTHROUGH;
16934 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16936 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); __PYX_ERR(0, 776, __pyx_L3_error)
16938 CYTHON_FALLTHROUGH;
16940 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16942 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); __PYX_ERR(0, 776, __pyx_L3_error)
16944 CYTHON_FALLTHROUGH;
16946 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16948 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); __PYX_ERR(0, 776, __pyx_L3_error)
16950 CYTHON_FALLTHROUGH;
16952 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16954 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); __PYX_ERR(0, 776, __pyx_L3_error)
16956 CYTHON_FALLTHROUGH;
16959 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
16960 if (value) { values[8] = value; kw_args--; }
16963 if (unlikely(kw_args > 0)) {
16964 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
16967 switch (PyTuple_GET_SIZE(__pyx_args)) {
16968 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16969 CYTHON_FALLTHROUGH;
16970 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16971 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16972 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16973 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16974 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16975 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16976 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16977 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16979 default:
goto __pyx_L5_argtuple_error;
16982 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
16983 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
16984 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
16985 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
16986 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16987 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16988 __pyx_v_x = ((PyArrayObject *)values[6]);
16989 __pyx_v_v = ((PyArrayObject *)values[7]);
16991 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L3_error)
16993 __pyx_v_zvelocity = ((double)0.0);
16996 goto __pyx_L4_argument_unpacking_done;
16997 __pyx_L5_argtuple_error:;
16998 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 776, __pyx_L3_error)
17000 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17001 __Pyx_RefNannyFinishContext();
17003 __pyx_L4_argument_unpacking_done:;
17004 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 781, __pyx_L1_error)
17005 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
17006 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
17013 __Pyx_RefNannyFinishContext();
17017 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
17021 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
17022 __Pyx_Buffer __pyx_pybuffer_v;
17023 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
17024 __Pyx_Buffer __pyx_pybuffer_x;
17025 PyObject *__pyx_r = NULL;
17026 __Pyx_RefNannyDeclarations
17028 npy_intp __pyx_t_2;
17029 npy_intp __pyx_t_3;
17031 npy_intp __pyx_t_5;
17032 npy_intp __pyx_t_6;
17034 Py_ssize_t __pyx_t_8;
17035 Py_ssize_t __pyx_t_9;
17036 Py_ssize_t __pyx_t_10;
17038 Py_ssize_t __pyx_t_12;
17039 Py_ssize_t __pyx_t_13;
17040 Py_ssize_t __pyx_t_14;
17041 Py_ssize_t __pyx_t_15;
17042 Py_ssize_t __pyx_t_16;
17043 Py_ssize_t __pyx_t_17;
17044 Py_ssize_t __pyx_t_18;
17045 Py_ssize_t __pyx_t_19;
17046 Py_ssize_t __pyx_t_20;
17047 Py_ssize_t __pyx_t_21;
17048 Py_ssize_t __pyx_t_22;
17049 Py_ssize_t __pyx_t_23;
17050 PyObject *__pyx_t_24 = NULL;
17051 PyObject *__pyx_t_25 = NULL;
17052 PyObject *__pyx_t_26 = NULL;
17055 PyObject *__pyx_t_29 = NULL;
17056 Py_ssize_t __pyx_t_30;
17057 Py_ssize_t __pyx_t_31;
17058 Py_ssize_t __pyx_t_32;
17059 Py_ssize_t __pyx_t_33;
17060 Py_ssize_t __pyx_t_34;
17061 Py_ssize_t __pyx_t_35;
17062 Py_ssize_t __pyx_t_36;
17063 Py_ssize_t __pyx_t_37;
17064 Py_ssize_t __pyx_t_38;
17065 Py_ssize_t __pyx_t_39;
17066 Py_ssize_t __pyx_t_40;
17067 Py_ssize_t __pyx_t_41;
17068 Py_ssize_t __pyx_t_42;
17069 Py_ssize_t __pyx_t_43;
17070 Py_ssize_t __pyx_t_44;
17071 Py_ssize_t __pyx_t_45;
17072 Py_ssize_t __pyx_t_46;
17073 Py_ssize_t __pyx_t_47;
17074 Py_ssize_t __pyx_t_48;
17075 Py_ssize_t __pyx_t_49;
17076 Py_ssize_t __pyx_t_50;
17077 Py_ssize_t __pyx_t_51;
17078 Py_ssize_t __pyx_t_52;
17079 Py_ssize_t __pyx_t_53;
17080 Py_ssize_t __pyx_t_54;
17081 Py_ssize_t __pyx_t_55;
17082 Py_ssize_t __pyx_t_56;
17083 Py_ssize_t __pyx_t_57;
17084 Py_ssize_t __pyx_t_58;
17085 Py_ssize_t __pyx_t_59;
17086 Py_ssize_t __pyx_t_60;
17087 Py_ssize_t __pyx_t_61;
17088 Py_ssize_t __pyx_t_62;
17089 Py_ssize_t __pyx_t_63;
17090 Py_ssize_t __pyx_t_64;
17091 Py_ssize_t __pyx_t_65;
17092 Py_ssize_t __pyx_t_66;
17093 Py_ssize_t __pyx_t_67;
17094 Py_ssize_t __pyx_t_68;
17095 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
17096 __pyx_pybuffer_x.pybuffer.buf = NULL;
17097 __pyx_pybuffer_x.refcount = 0;
17098 __pyx_pybuffernd_x.data = NULL;
17099 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17100 __pyx_pybuffer_v.pybuffer.buf = NULL;
17101 __pyx_pybuffer_v.refcount = 0;
17102 __pyx_pybuffernd_v.data = NULL;
17103 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17105 __Pyx_BufFmt_StackElem __pyx_stack[1];
17106 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
17108 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
17110 __Pyx_BufFmt_StackElem __pyx_stack[1];
17111 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
17113 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
17131 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
17141 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17151 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17152 __pyx_t_3 = __pyx_t_2;
17153 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17154 __pyx_v_eN = __pyx_t_4;
17163 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17164 __pyx_t_6 = __pyx_t_5;
17165 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17166 __pyx_v_k = __pyx_t_7;
17175 __pyx_t_8 = __pyx_v_eN;
17176 __pyx_t_9 = __pyx_v_k;
17179 if (__pyx_t_8 < 0) {
17180 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17181 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17182 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17183 if (__pyx_t_9 < 0) {
17184 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17185 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17186 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17187 if (__pyx_t_10 < 0) {
17188 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17189 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17190 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17191 if (unlikely(__pyx_t_11 != -1)) {
17192 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17193 __PYX_ERR(0, 791, __pyx_L1_error)
17195 __pyx_t_12 = __pyx_v_eN;
17196 __pyx_t_13 = __pyx_v_k;
17199 if (__pyx_t_12 < 0) {
17200 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17201 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17202 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17203 if (__pyx_t_13 < 0) {
17204 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17205 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17206 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17207 if (__pyx_t_14 < 0) {
17208 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17209 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17210 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17211 if (unlikely(__pyx_t_11 != -1)) {
17212 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17213 __PYX_ERR(0, 791, __pyx_L1_error)
17215 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17224 __pyx_t_15 = __pyx_v_eN;
17225 __pyx_t_16 = __pyx_v_k;
17228 if (__pyx_t_15 < 0) {
17229 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
17230 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
17231 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17232 if (__pyx_t_16 < 0) {
17233 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
17234 if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 1;
17235 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17236 if (__pyx_t_17 < 0) {
17237 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
17238 if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 2;
17239 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17240 if (unlikely(__pyx_t_11 != -1)) {
17241 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17242 __PYX_ERR(0, 792, __pyx_L1_error)
17244 __pyx_t_18 = __pyx_v_eN;
17245 __pyx_t_19 = __pyx_v_k;
17248 if (__pyx_t_18 < 0) {
17249 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
17250 if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 0;
17251 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17252 if (__pyx_t_19 < 0) {
17253 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
17254 if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 1;
17255 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17256 if (__pyx_t_20 < 0) {
17257 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
17258 if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 2;
17259 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17260 if (unlikely(__pyx_t_11 != -1)) {
17261 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17262 __PYX_ERR(0, 792, __pyx_L1_error)
17264 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides))));
17273 __pyx_t_21 = __pyx_v_eN;
17274 __pyx_t_22 = __pyx_v_k;
17277 if (__pyx_t_21 < 0) {
17278 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
17279 if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0;
17280 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17281 if (__pyx_t_22 < 0) {
17282 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
17283 if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 1;
17284 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17285 if (__pyx_t_23 < 0) {
17286 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
17287 if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 2;
17288 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17289 if (unlikely(__pyx_t_11 != -1)) {
17290 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17291 __PYX_ERR(0, 793, __pyx_L1_error)
17293 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17302 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 794, __pyx_L1_error)
17303 __Pyx_GOTREF(__pyx_t_24);
17304 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 794, __pyx_L1_error)
17305 __Pyx_GOTREF(__pyx_t_25);
17306 __pyx_t_26 = PyTuple_New(3);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 794, __pyx_L1_error)
17307 __Pyx_GOTREF(__pyx_t_26);
17308 __Pyx_GIVEREF(__pyx_t_24);
17309 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_24);
17310 __Pyx_GIVEREF(__pyx_t_25);
17311 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_25);
17312 __Pyx_INCREF(__pyx_slice__3);
17313 __Pyx_GIVEREF(__pyx_slice__3);
17314 PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_slice__3);
17317 __pyx_t_25 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_26);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 794, __pyx_L1_error)
17318 __Pyx_GOTREF(__pyx_t_25);
17319 __pyx_t_27 = (__pyx_v_tForReversal - __pyx_v_t);
17320 __pyx_t_28 = (__pyx_v_tForReversal - 0.0);
17321 if (unlikely(__pyx_t_28 == 0)) {
17322 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17323 __PYX_ERR(0, 794, __pyx_L1_error)
17325 __pyx_t_24 = PyFloat_FromDouble(((__pyx_t_27 / __pyx_t_28) * __pyx_v_clock));
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 794, __pyx_L1_error)
17326 __Pyx_GOTREF(__pyx_t_24);
17327 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_25, __pyx_t_24);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 794, __pyx_L1_error)
17328 __Pyx_GOTREF(__pyx_t_29);
17329 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
17330 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
17331 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_26, __pyx_t_29) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
17332 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
17333 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
17355 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17356 __pyx_t_3 = __pyx_t_2;
17357 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17358 __pyx_v_eN = __pyx_t_4;
17367 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17368 __pyx_t_6 = __pyx_t_5;
17369 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17370 __pyx_v_k = __pyx_t_7;
17379 __pyx_t_30 = __pyx_v_eN;
17380 __pyx_t_31 = __pyx_v_k;
17383 if (__pyx_t_30 < 0) {
17384 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[0].shape;
17385 if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0;
17386 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17387 if (__pyx_t_31 < 0) {
17388 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[1].shape;
17389 if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 1;
17390 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17391 if (__pyx_t_32 < 0) {
17392 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[2].shape;
17393 if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 2;
17394 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17395 if (unlikely(__pyx_t_11 != -1)) {
17396 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17397 __PYX_ERR(0, 798, __pyx_L1_error)
17399 __pyx_t_33 = __pyx_v_eN;
17400 __pyx_t_34 = __pyx_v_k;
17403 if (__pyx_t_33 < 0) {
17404 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[0].shape;
17405 if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0;
17406 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17407 if (__pyx_t_34 < 0) {
17408 __pyx_t_34 += __pyx_pybuffernd_v.diminfo[1].shape;
17409 if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 1;
17410 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17411 if (__pyx_t_35 < 0) {
17412 __pyx_t_35 += __pyx_pybuffernd_v.diminfo[2].shape;
17413 if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 2;
17414 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17415 if (unlikely(__pyx_t_11 != -1)) {
17416 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17417 __PYX_ERR(0, 798, __pyx_L1_error)
17419 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17428 __pyx_t_36 = __pyx_v_eN;
17429 __pyx_t_37 = __pyx_v_k;
17432 if (__pyx_t_36 < 0) {
17433 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[0].shape;
17434 if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0;
17435 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17436 if (__pyx_t_37 < 0) {
17437 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[1].shape;
17438 if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 1;
17439 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17440 if (__pyx_t_38 < 0) {
17441 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[2].shape;
17442 if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 2;
17443 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17444 if (unlikely(__pyx_t_11 != -1)) {
17445 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17446 __PYX_ERR(0, 799, __pyx_L1_error)
17448 __pyx_t_39 = __pyx_v_eN;
17449 __pyx_t_40 = __pyx_v_k;
17452 if (__pyx_t_39 < 0) {
17453 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
17454 if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0;
17455 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17456 if (__pyx_t_40 < 0) {
17457 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
17458 if (unlikely(__pyx_t_40 < 0)) __pyx_t_11 = 1;
17459 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17460 if (__pyx_t_41 < 0) {
17461 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
17462 if (unlikely(__pyx_t_41 < 0)) __pyx_t_11 = 2;
17463 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17464 if (unlikely(__pyx_t_11 != -1)) {
17465 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17466 __PYX_ERR(0, 799, __pyx_L1_error)
17468 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[2].strides))));
17477 __pyx_t_42 = __pyx_v_eN;
17478 __pyx_t_43 = __pyx_v_k;
17481 if (__pyx_t_42 < 0) {
17482 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
17483 if (unlikely(__pyx_t_42 < 0)) __pyx_t_11 = 0;
17484 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17485 if (__pyx_t_43 < 0) {
17486 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
17487 if (unlikely(__pyx_t_43 < 0)) __pyx_t_11 = 1;
17488 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17489 if (__pyx_t_44 < 0) {
17490 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
17491 if (unlikely(__pyx_t_44 < 0)) __pyx_t_11 = 2;
17492 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17493 if (unlikely(__pyx_t_11 != -1)) {
17494 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17495 __PYX_ERR(0, 800, __pyx_L1_error)
17497 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17521 #ifndef CYTHON_WITHOUT_ASSERTIONS
17522 if (unlikely(!Py_OptimizeFlag)) {
17523 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
17524 PyErr_SetNone(PyExc_AssertionError);
17525 __PYX_ERR(0, 802, __pyx_L1_error)
17537 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17547 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17548 __pyx_t_3 = __pyx_t_2;
17549 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17550 __pyx_v_eN = __pyx_t_4;
17559 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17560 __pyx_t_6 = __pyx_t_5;
17561 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17562 __pyx_v_k = __pyx_t_7;
17571 __pyx_t_45 = __pyx_v_eN;
17572 __pyx_t_46 = __pyx_v_k;
17575 if (__pyx_t_45 < 0) {
17576 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[0].shape;
17577 if (unlikely(__pyx_t_45 < 0)) __pyx_t_11 = 0;
17578 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17579 if (__pyx_t_46 < 0) {
17580 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[1].shape;
17581 if (unlikely(__pyx_t_46 < 0)) __pyx_t_11 = 1;
17582 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17583 if (__pyx_t_47 < 0) {
17584 __pyx_t_47 += __pyx_pybuffernd_x.diminfo[2].shape;
17585 if (unlikely(__pyx_t_47 < 0)) __pyx_t_11 = 2;
17586 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17587 if (unlikely(__pyx_t_11 != -1)) {
17588 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17589 __PYX_ERR(0, 806, __pyx_L1_error)
17591 __pyx_t_48 = __pyx_v_eN;
17592 __pyx_t_49 = __pyx_v_k;
17595 if (__pyx_t_48 < 0) {
17596 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[0].shape;
17597 if (unlikely(__pyx_t_48 < 0)) __pyx_t_11 = 0;
17598 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17599 if (__pyx_t_49 < 0) {
17600 __pyx_t_49 += __pyx_pybuffernd_v.diminfo[1].shape;
17601 if (unlikely(__pyx_t_49 < 0)) __pyx_t_11 = 1;
17602 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17603 if (__pyx_t_50 < 0) {
17604 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[2].shape;
17605 if (unlikely(__pyx_t_50 < 0)) __pyx_t_11 = 2;
17606 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17607 if (unlikely(__pyx_t_11 != -1)) {
17608 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17609 __PYX_ERR(0, 806, __pyx_L1_error)
17611 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_46, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_47, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17620 __pyx_t_51 = __pyx_v_eN;
17621 __pyx_t_52 = __pyx_v_k;
17624 if (__pyx_t_51 < 0) {
17625 __pyx_t_51 += __pyx_pybuffernd_x.diminfo[0].shape;
17626 if (unlikely(__pyx_t_51 < 0)) __pyx_t_11 = 0;
17627 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17628 if (__pyx_t_52 < 0) {
17629 __pyx_t_52 += __pyx_pybuffernd_x.diminfo[1].shape;
17630 if (unlikely(__pyx_t_52 < 0)) __pyx_t_11 = 1;
17631 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17632 if (__pyx_t_53 < 0) {
17633 __pyx_t_53 += __pyx_pybuffernd_x.diminfo[2].shape;
17634 if (unlikely(__pyx_t_53 < 0)) __pyx_t_11 = 2;
17635 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17636 if (unlikely(__pyx_t_11 != -1)) {
17637 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17638 __PYX_ERR(0, 807, __pyx_L1_error)
17640 __pyx_t_54 = __pyx_v_eN;
17641 __pyx_t_55 = __pyx_v_k;
17644 if (__pyx_t_54 < 0) {
17645 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[0].shape;
17646 if (unlikely(__pyx_t_54 < 0)) __pyx_t_11 = 0;
17647 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17648 if (__pyx_t_55 < 0) {
17649 __pyx_t_55 += __pyx_pybuffernd_v.diminfo[1].shape;
17650 if (unlikely(__pyx_t_55 < 0)) __pyx_t_11 = 1;
17651 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17652 if (__pyx_t_56 < 0) {
17653 __pyx_t_56 += __pyx_pybuffernd_v.diminfo[2].shape;
17654 if (unlikely(__pyx_t_56 < 0)) __pyx_t_11 = 2;
17655 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17656 if (unlikely(__pyx_t_11 != -1)) {
17657 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17658 __PYX_ERR(0, 807, __pyx_L1_error)
17660 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_x.diminfo[2].strides))));
17669 __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 808, __pyx_L1_error)
17670 __Pyx_GOTREF(__pyx_t_26);
17671 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 808, __pyx_L1_error)
17672 __Pyx_GOTREF(__pyx_t_29);
17673 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 808, __pyx_L1_error)
17674 __Pyx_GOTREF(__pyx_t_24);
17675 __Pyx_GIVEREF(__pyx_t_26);
17676 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_26);
17677 __Pyx_GIVEREF(__pyx_t_29);
17678 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_29);
17679 __Pyx_INCREF(__pyx_slice__4);
17680 __Pyx_GIVEREF(__pyx_slice__4);
17681 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_slice__4);
17684 __pyx_t_29 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_24);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 808, __pyx_L1_error)
17685 __Pyx_GOTREF(__pyx_t_29);
17686 __pyx_t_28 = (__pyx_v_tForReversal - __pyx_v_t);
17687 __pyx_t_27 = (__pyx_v_tForReversal - 0.0);
17688 if (unlikely(__pyx_t_27 == 0)) {
17689 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17690 __PYX_ERR(0, 808, __pyx_L1_error)
17692 __pyx_t_26 = PyFloat_FromDouble(((__pyx_t_28 / __pyx_t_27) * __pyx_v_clock));
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 808, __pyx_L1_error)
17693 __Pyx_GOTREF(__pyx_t_26);
17694 __pyx_t_25 = PyNumber_InPlaceMultiply(__pyx_t_29, __pyx_t_26);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 808, __pyx_L1_error)
17695 __Pyx_GOTREF(__pyx_t_25);
17696 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
17697 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
17698 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_24, __pyx_t_25) < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
17699 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
17700 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
17722 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17723 __pyx_t_3 = __pyx_t_2;
17724 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17725 __pyx_v_eN = __pyx_t_4;
17734 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17735 __pyx_t_6 = __pyx_t_5;
17736 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17737 __pyx_v_k = __pyx_t_7;
17746 __pyx_t_57 = __pyx_v_eN;
17747 __pyx_t_58 = __pyx_v_k;
17750 if (__pyx_t_57 < 0) {
17751 __pyx_t_57 += __pyx_pybuffernd_x.diminfo[0].shape;
17752 if (unlikely(__pyx_t_57 < 0)) __pyx_t_11 = 0;
17753 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17754 if (__pyx_t_58 < 0) {
17755 __pyx_t_58 += __pyx_pybuffernd_x.diminfo[1].shape;
17756 if (unlikely(__pyx_t_58 < 0)) __pyx_t_11 = 1;
17757 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17758 if (__pyx_t_59 < 0) {
17759 __pyx_t_59 += __pyx_pybuffernd_x.diminfo[2].shape;
17760 if (unlikely(__pyx_t_59 < 0)) __pyx_t_11 = 2;
17761 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17762 if (unlikely(__pyx_t_11 != -1)) {
17763 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17764 __PYX_ERR(0, 812, __pyx_L1_error)
17766 __pyx_t_60 = __pyx_v_eN;
17767 __pyx_t_61 = __pyx_v_k;
17770 if (__pyx_t_60 < 0) {
17771 __pyx_t_60 += __pyx_pybuffernd_v.diminfo[0].shape;
17772 if (unlikely(__pyx_t_60 < 0)) __pyx_t_11 = 0;
17773 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17774 if (__pyx_t_61 < 0) {
17775 __pyx_t_61 += __pyx_pybuffernd_v.diminfo[1].shape;
17776 if (unlikely(__pyx_t_61 < 0)) __pyx_t_11 = 1;
17777 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17778 if (__pyx_t_62 < 0) {
17779 __pyx_t_62 += __pyx_pybuffernd_v.diminfo[2].shape;
17780 if (unlikely(__pyx_t_62 < 0)) __pyx_t_11 = 2;
17781 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17782 if (unlikely(__pyx_t_11 != -1)) {
17783 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17784 __PYX_ERR(0, 812, __pyx_L1_error)
17786 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_61, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_62, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_57, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_58, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_59, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17795 __pyx_t_63 = __pyx_v_eN;
17796 __pyx_t_64 = __pyx_v_k;
17799 if (__pyx_t_63 < 0) {
17800 __pyx_t_63 += __pyx_pybuffernd_x.diminfo[0].shape;
17801 if (unlikely(__pyx_t_63 < 0)) __pyx_t_11 = 0;
17802 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17803 if (__pyx_t_64 < 0) {
17804 __pyx_t_64 += __pyx_pybuffernd_x.diminfo[1].shape;
17805 if (unlikely(__pyx_t_64 < 0)) __pyx_t_11 = 1;
17806 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17807 if (__pyx_t_65 < 0) {
17808 __pyx_t_65 += __pyx_pybuffernd_x.diminfo[2].shape;
17809 if (unlikely(__pyx_t_65 < 0)) __pyx_t_11 = 2;
17810 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17811 if (unlikely(__pyx_t_11 != -1)) {
17812 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17813 __PYX_ERR(0, 813, __pyx_L1_error)
17815 __pyx_t_66 = __pyx_v_eN;
17816 __pyx_t_67 = __pyx_v_k;
17819 if (__pyx_t_66 < 0) {
17820 __pyx_t_66 += __pyx_pybuffernd_v.diminfo[0].shape;
17821 if (unlikely(__pyx_t_66 < 0)) __pyx_t_11 = 0;
17822 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17823 if (__pyx_t_67 < 0) {
17824 __pyx_t_67 += __pyx_pybuffernd_v.diminfo[1].shape;
17825 if (unlikely(__pyx_t_67 < 0)) __pyx_t_11 = 1;
17826 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17827 if (__pyx_t_68 < 0) {
17828 __pyx_t_68 += __pyx_pybuffernd_v.diminfo[2].shape;
17829 if (unlikely(__pyx_t_68 < 0)) __pyx_t_11 = 2;
17830 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17831 if (unlikely(__pyx_t_11 != -1)) {
17832 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17833 __PYX_ERR(0, 813, __pyx_L1_error)
17835 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_68, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_x.diminfo[2].strides))));
17852 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17855 __Pyx_XDECREF(__pyx_t_24);
17856 __Pyx_XDECREF(__pyx_t_25);
17857 __Pyx_XDECREF(__pyx_t_26);
17858 __Pyx_XDECREF(__pyx_t_29);
17859 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17860 __Pyx_PyThreadState_declare
17861 __Pyx_PyThreadState_assign
17862 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17863 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17864 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17865 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17866 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17870 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17871 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17873 __Pyx_XGIVEREF(__pyx_r);
17874 __Pyx_RefNannyFinishContext();
17887 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17888 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
17889 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17890 int __pyx_v_transient;
17892 double __pyx_v_tForReversal;
17893 double __pyx_v_clock;
17896 PyArrayObject *__pyx_v_x = 0;
17897 PyArrayObject *__pyx_v_v = 0;
17898 double __pyx_v_zvelocity;
17899 PyObject *__pyx_r = 0;
17900 __Pyx_RefNannyDeclarations
17901 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
17903 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
17904 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17905 if (unlikely(__pyx_kwds)) {
17906 Py_ssize_t kw_args;
17907 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17908 switch (pos_args) {
17909 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17910 CYTHON_FALLTHROUGH;
17911 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17912 CYTHON_FALLTHROUGH;
17913 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17914 CYTHON_FALLTHROUGH;
17915 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17916 CYTHON_FALLTHROUGH;
17917 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17918 CYTHON_FALLTHROUGH;
17919 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17920 CYTHON_FALLTHROUGH;
17921 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17922 CYTHON_FALLTHROUGH;
17923 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17924 CYTHON_FALLTHROUGH;
17925 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17926 CYTHON_FALLTHROUGH;
17928 default:
goto __pyx_L5_argtuple_error;
17930 kw_args = PyDict_Size(__pyx_kwds);
17931 switch (pos_args) {
17933 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17934 else goto __pyx_L5_argtuple_error;
17935 CYTHON_FALLTHROUGH;
17937 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17939 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); __PYX_ERR(0, 816, __pyx_L3_error)
17941 CYTHON_FALLTHROUGH;
17943 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17945 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); __PYX_ERR(0, 816, __pyx_L3_error)
17947 CYTHON_FALLTHROUGH;
17949 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17951 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); __PYX_ERR(0, 816, __pyx_L3_error)
17953 CYTHON_FALLTHROUGH;
17955 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17957 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); __PYX_ERR(0, 816, __pyx_L3_error)
17959 CYTHON_FALLTHROUGH;
17961 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17963 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); __PYX_ERR(0, 816, __pyx_L3_error)
17965 CYTHON_FALLTHROUGH;
17967 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17969 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); __PYX_ERR(0, 816, __pyx_L3_error)
17971 CYTHON_FALLTHROUGH;
17973 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17975 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); __PYX_ERR(0, 816, __pyx_L3_error)
17977 CYTHON_FALLTHROUGH;
17980 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
17981 if (value) { values[8] = value; kw_args--; }
17984 if (unlikely(kw_args > 0)) {
17985 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) __PYX_ERR(0, 816, __pyx_L3_error)
17988 switch (PyTuple_GET_SIZE(__pyx_args)) {
17989 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17990 CYTHON_FALLTHROUGH;
17991 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17992 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17993 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17994 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17995 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17996 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17997 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17998 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18000 default:
goto __pyx_L5_argtuple_error;
18003 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L3_error)
18004 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
18005 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
18006 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
18007 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
18008 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
18009 __pyx_v_x = ((PyArrayObject *)values[6]);
18010 __pyx_v_v = ((PyArrayObject *)values[7]);
18012 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
18014 __pyx_v_zvelocity = ((double)0.0);
18017 goto __pyx_L4_argument_unpacking_done;
18018 __pyx_L5_argtuple_error:;
18019 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 816, __pyx_L3_error)
18021 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18022 __Pyx_RefNannyFinishContext();
18024 __pyx_L4_argument_unpacking_done:;
18025 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 821, __pyx_L1_error)
18026 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
18027 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
18034 __Pyx_RefNannyFinishContext();
18038 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
18043 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
18044 __Pyx_Buffer __pyx_pybuffer_v;
18045 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
18046 __Pyx_Buffer __pyx_pybuffer_x;
18047 PyObject *__pyx_r = NULL;
18048 __Pyx_RefNannyDeclarations
18050 npy_intp __pyx_t_2;
18051 npy_intp __pyx_t_3;
18053 npy_intp __pyx_t_5;
18054 npy_intp __pyx_t_6;
18056 npy_intp __pyx_t_8;
18057 npy_intp __pyx_t_9;
18059 Py_ssize_t __pyx_t_11;
18060 Py_ssize_t __pyx_t_12;
18061 Py_ssize_t __pyx_t_13;
18062 Py_ssize_t __pyx_t_14;
18064 Py_ssize_t __pyx_t_16;
18065 Py_ssize_t __pyx_t_17;
18066 Py_ssize_t __pyx_t_18;
18067 Py_ssize_t __pyx_t_19;
18068 Py_ssize_t __pyx_t_20;
18069 Py_ssize_t __pyx_t_21;
18070 Py_ssize_t __pyx_t_22;
18071 Py_ssize_t __pyx_t_23;
18072 Py_ssize_t __pyx_t_24;
18073 Py_ssize_t __pyx_t_25;
18074 Py_ssize_t __pyx_t_26;
18075 Py_ssize_t __pyx_t_27;
18076 Py_ssize_t __pyx_t_28;
18077 Py_ssize_t __pyx_t_29;
18078 Py_ssize_t __pyx_t_30;
18079 Py_ssize_t __pyx_t_31;
18080 PyObject *__pyx_t_32 = NULL;
18081 PyObject *__pyx_t_33 = NULL;
18082 PyObject *__pyx_t_34 = NULL;
18083 PyObject *__pyx_t_35 = NULL;
18086 Py_ssize_t __pyx_t_38;
18087 Py_ssize_t __pyx_t_39;
18088 Py_ssize_t __pyx_t_40;
18089 Py_ssize_t __pyx_t_41;
18090 Py_ssize_t __pyx_t_42;
18091 Py_ssize_t __pyx_t_43;
18092 Py_ssize_t __pyx_t_44;
18093 Py_ssize_t __pyx_t_45;
18094 Py_ssize_t __pyx_t_46;
18095 Py_ssize_t __pyx_t_47;
18096 Py_ssize_t __pyx_t_48;
18097 Py_ssize_t __pyx_t_49;
18098 Py_ssize_t __pyx_t_50;
18099 Py_ssize_t __pyx_t_51;
18100 Py_ssize_t __pyx_t_52;
18101 Py_ssize_t __pyx_t_53;
18102 Py_ssize_t __pyx_t_54;
18103 Py_ssize_t __pyx_t_55;
18104 Py_ssize_t __pyx_t_56;
18105 Py_ssize_t __pyx_t_57;
18106 Py_ssize_t __pyx_t_58;
18107 Py_ssize_t __pyx_t_59;
18108 Py_ssize_t __pyx_t_60;
18109 Py_ssize_t __pyx_t_61;
18110 Py_ssize_t __pyx_t_62;
18111 Py_ssize_t __pyx_t_63;
18112 Py_ssize_t __pyx_t_64;
18113 Py_ssize_t __pyx_t_65;
18114 Py_ssize_t __pyx_t_66;
18115 Py_ssize_t __pyx_t_67;
18116 Py_ssize_t __pyx_t_68;
18117 Py_ssize_t __pyx_t_69;
18118 Py_ssize_t __pyx_t_70;
18119 Py_ssize_t __pyx_t_71;
18120 Py_ssize_t __pyx_t_72;
18121 Py_ssize_t __pyx_t_73;
18122 Py_ssize_t __pyx_t_74;
18123 Py_ssize_t __pyx_t_75;
18124 Py_ssize_t __pyx_t_76;
18125 Py_ssize_t __pyx_t_77;
18126 Py_ssize_t __pyx_t_78;
18127 Py_ssize_t __pyx_t_79;
18128 Py_ssize_t __pyx_t_80;
18129 Py_ssize_t __pyx_t_81;
18130 Py_ssize_t __pyx_t_82;
18131 Py_ssize_t __pyx_t_83;
18132 Py_ssize_t __pyx_t_84;
18133 Py_ssize_t __pyx_t_85;
18134 Py_ssize_t __pyx_t_86;
18135 Py_ssize_t __pyx_t_87;
18136 Py_ssize_t __pyx_t_88;
18137 Py_ssize_t __pyx_t_89;
18138 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
18139 __pyx_pybuffer_x.pybuffer.buf = NULL;
18140 __pyx_pybuffer_x.refcount = 0;
18141 __pyx_pybuffernd_x.data = NULL;
18142 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
18143 __pyx_pybuffer_v.pybuffer.buf = NULL;
18144 __pyx_pybuffer_v.refcount = 0;
18145 __pyx_pybuffernd_v.data = NULL;
18146 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
18148 __Pyx_BufFmt_StackElem __pyx_stack[1];
18149 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
18151 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
18153 __Pyx_BufFmt_StackElem __pyx_stack[1];
18154 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
18156 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
18174 __pyx_t_1 = (((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 3) != 0);
18184 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18194 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18195 __pyx_t_3 = __pyx_t_2;
18196 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18197 __pyx_v_eN = __pyx_t_4;
18206 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18207 __pyx_t_6 = __pyx_t_5;
18208 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18209 __pyx_v_ebN = __pyx_t_7;
18218 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18219 __pyx_t_9 = __pyx_t_8;
18220 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18221 __pyx_v_k = __pyx_t_10;
18230 __pyx_t_11 = __pyx_v_eN;
18231 __pyx_t_12 = __pyx_v_ebN;
18232 __pyx_t_13 = __pyx_v_k;
18235 if (__pyx_t_11 < 0) {
18236 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18237 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18238 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18239 if (__pyx_t_12 < 0) {
18240 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18241 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18242 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18243 if (__pyx_t_13 < 0) {
18244 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18245 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18246 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18247 if (__pyx_t_14 < 0) {
18248 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18249 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18250 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18251 if (unlikely(__pyx_t_15 != -1)) {
18252 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18253 __PYX_ERR(0, 832, __pyx_L1_error)
18255 __pyx_t_16 = __pyx_v_eN;
18256 __pyx_t_17 = __pyx_v_ebN;
18257 __pyx_t_18 = __pyx_v_k;
18260 if (__pyx_t_16 < 0) {
18261 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18262 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18263 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18264 if (__pyx_t_17 < 0) {
18265 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18266 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18267 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18268 if (__pyx_t_18 < 0) {
18269 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18270 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18271 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18272 if (__pyx_t_19 < 0) {
18273 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18274 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18275 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18276 if (unlikely(__pyx_t_15 != -1)) {
18277 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18278 __PYX_ERR(0, 832, __pyx_L1_error)
18280 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18289 __pyx_t_20 = __pyx_v_eN;
18290 __pyx_t_21 = __pyx_v_ebN;
18291 __pyx_t_22 = __pyx_v_k;
18294 if (__pyx_t_20 < 0) {
18295 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
18296 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 0;
18297 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18298 if (__pyx_t_21 < 0) {
18299 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
18300 if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 1;
18301 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18302 if (__pyx_t_22 < 0) {
18303 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[2].shape;
18304 if (unlikely(__pyx_t_22 < 0)) __pyx_t_15 = 2;
18305 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18306 if (__pyx_t_23 < 0) {
18307 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[3].shape;
18308 if (unlikely(__pyx_t_23 < 0)) __pyx_t_15 = 3;
18309 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18310 if (unlikely(__pyx_t_15 != -1)) {
18311 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18312 __PYX_ERR(0, 833, __pyx_L1_error)
18314 __pyx_t_24 = __pyx_v_eN;
18315 __pyx_t_25 = __pyx_v_ebN;
18316 __pyx_t_26 = __pyx_v_k;
18319 if (__pyx_t_24 < 0) {
18320 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[0].shape;
18321 if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
18322 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18323 if (__pyx_t_25 < 0) {
18324 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
18325 if (unlikely(__pyx_t_25 < 0)) __pyx_t_15 = 1;
18326 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18327 if (__pyx_t_26 < 0) {
18328 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[2].shape;
18329 if (unlikely(__pyx_t_26 < 0)) __pyx_t_15 = 2;
18330 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18331 if (__pyx_t_27 < 0) {
18332 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[3].shape;
18333 if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 3;
18334 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18335 if (unlikely(__pyx_t_15 != -1)) {
18336 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18337 __PYX_ERR(0, 833, __pyx_L1_error)
18339 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_x.diminfo[3].strides))));
18348 __pyx_t_28 = __pyx_v_eN;
18349 __pyx_t_29 = __pyx_v_ebN;
18350 __pyx_t_30 = __pyx_v_k;
18353 if (__pyx_t_28 < 0) {
18354 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[0].shape;
18355 if (unlikely(__pyx_t_28 < 0)) __pyx_t_15 = 0;
18356 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18357 if (__pyx_t_29 < 0) {
18358 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[1].shape;
18359 if (unlikely(__pyx_t_29 < 0)) __pyx_t_15 = 1;
18360 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18361 if (__pyx_t_30 < 0) {
18362 __pyx_t_30 += __pyx_pybuffernd_v.diminfo[2].shape;
18363 if (unlikely(__pyx_t_30 < 0)) __pyx_t_15 = 2;
18364 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18365 if (__pyx_t_31 < 0) {
18366 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[3].shape;
18367 if (unlikely(__pyx_t_31 < 0)) __pyx_t_15 = 3;
18368 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18369 if (unlikely(__pyx_t_15 != -1)) {
18370 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18371 __PYX_ERR(0, 834, __pyx_L1_error)
18373 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18382 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 835, __pyx_L1_error)
18383 __Pyx_GOTREF(__pyx_t_32);
18384 __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
18385 __Pyx_GOTREF(__pyx_t_33);
18386 __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
18387 __Pyx_GOTREF(__pyx_t_34);
18388 __pyx_t_35 = PyTuple_New(4);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 835, __pyx_L1_error)
18389 __Pyx_GOTREF(__pyx_t_35);
18390 __Pyx_GIVEREF(__pyx_t_32);
18391 PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_32);
18392 __Pyx_GIVEREF(__pyx_t_33);
18393 PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_33);
18394 __Pyx_GIVEREF(__pyx_t_34);
18395 PyTuple_SET_ITEM(__pyx_t_35, 2, __pyx_t_34);
18396 __Pyx_INCREF(__pyx_slice__5);
18397 __Pyx_GIVEREF(__pyx_slice__5);
18398 PyTuple_SET_ITEM(__pyx_t_35, 3, __pyx_slice__5);
18402 __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_35);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 835, __pyx_L1_error)
18403 __Pyx_GOTREF(__pyx_t_34);
18404 __pyx_t_36 = (__pyx_v_tForReversal - __pyx_v_t);
18405 __pyx_t_37 = (__pyx_v_tForReversal - 0.0);
18406 if (unlikely(__pyx_t_37 == 0)) {
18407 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18408 __PYX_ERR(0, 835, __pyx_L1_error)
18410 __pyx_t_33 = PyFloat_FromDouble(((__pyx_t_36 / __pyx_t_37) * __pyx_v_clock));
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 835, __pyx_L1_error)
18411 __Pyx_GOTREF(__pyx_t_33);
18412 __pyx_t_32 = PyNumber_InPlaceMultiply(__pyx_t_34, __pyx_t_33);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 835, __pyx_L1_error)
18413 __Pyx_GOTREF(__pyx_t_32);
18414 __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
18415 __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
18416 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_35, __pyx_t_32) < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
18417 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
18418 __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
18441 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18442 __pyx_t_3 = __pyx_t_2;
18443 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18444 __pyx_v_eN = __pyx_t_4;
18453 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18454 __pyx_t_6 = __pyx_t_5;
18455 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18456 __pyx_v_ebN = __pyx_t_7;
18465 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18466 __pyx_t_9 = __pyx_t_8;
18467 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18468 __pyx_v_k = __pyx_t_10;
18477 __pyx_t_38 = __pyx_v_eN;
18478 __pyx_t_39 = __pyx_v_ebN;
18479 __pyx_t_40 = __pyx_v_k;
18482 if (__pyx_t_38 < 0) {
18483 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[0].shape;
18484 if (unlikely(__pyx_t_38 < 0)) __pyx_t_15 = 0;
18485 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18486 if (__pyx_t_39 < 0) {
18487 __pyx_t_39 += __pyx_pybuffernd_x.diminfo[1].shape;
18488 if (unlikely(__pyx_t_39 < 0)) __pyx_t_15 = 1;
18489 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18490 if (__pyx_t_40 < 0) {
18491 __pyx_t_40 += __pyx_pybuffernd_x.diminfo[2].shape;
18492 if (unlikely(__pyx_t_40 < 0)) __pyx_t_15 = 2;
18493 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18494 if (__pyx_t_41 < 0) {
18495 __pyx_t_41 += __pyx_pybuffernd_x.diminfo[3].shape;
18496 if (unlikely(__pyx_t_41 < 0)) __pyx_t_15 = 3;
18497 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18498 if (unlikely(__pyx_t_15 != -1)) {
18499 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18500 __PYX_ERR(0, 840, __pyx_L1_error)
18502 __pyx_t_42 = __pyx_v_eN;
18503 __pyx_t_43 = __pyx_v_ebN;
18504 __pyx_t_44 = __pyx_v_k;
18507 if (__pyx_t_42 < 0) {
18508 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
18509 if (unlikely(__pyx_t_42 < 0)) __pyx_t_15 = 0;
18510 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18511 if (__pyx_t_43 < 0) {
18512 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
18513 if (unlikely(__pyx_t_43 < 0)) __pyx_t_15 = 1;
18514 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18515 if (__pyx_t_44 < 0) {
18516 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
18517 if (unlikely(__pyx_t_44 < 0)) __pyx_t_15 = 2;
18518 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18519 if (__pyx_t_45 < 0) {
18520 __pyx_t_45 += __pyx_pybuffernd_v.diminfo[3].shape;
18521 if (unlikely(__pyx_t_45 < 0)) __pyx_t_15 = 3;
18522 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18523 if (unlikely(__pyx_t_15 != -1)) {
18524 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18525 __PYX_ERR(0, 840, __pyx_L1_error)
18527 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_45, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_41, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18536 __pyx_t_46 = __pyx_v_eN;
18537 __pyx_t_47 = __pyx_v_ebN;
18538 __pyx_t_48 = __pyx_v_k;
18541 if (__pyx_t_46 < 0) {
18542 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[0].shape;
18543 if (unlikely(__pyx_t_46 < 0)) __pyx_t_15 = 0;
18544 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18545 if (__pyx_t_47 < 0) {
18546 __pyx_t_47 += __pyx_pybuffernd_x.diminfo[1].shape;
18547 if (unlikely(__pyx_t_47 < 0)) __pyx_t_15 = 1;
18548 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18549 if (__pyx_t_48 < 0) {
18550 __pyx_t_48 += __pyx_pybuffernd_x.diminfo[2].shape;
18551 if (unlikely(__pyx_t_48 < 0)) __pyx_t_15 = 2;
18552 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18553 if (__pyx_t_49 < 0) {
18554 __pyx_t_49 += __pyx_pybuffernd_x.diminfo[3].shape;
18555 if (unlikely(__pyx_t_49 < 0)) __pyx_t_15 = 3;
18556 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18557 if (unlikely(__pyx_t_15 != -1)) {
18558 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18559 __PYX_ERR(0, 841, __pyx_L1_error)
18561 __pyx_t_50 = __pyx_v_eN;
18562 __pyx_t_51 = __pyx_v_ebN;
18563 __pyx_t_52 = __pyx_v_k;
18566 if (__pyx_t_50 < 0) {
18567 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[0].shape;
18568 if (unlikely(__pyx_t_50 < 0)) __pyx_t_15 = 0;
18569 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18570 if (__pyx_t_51 < 0) {
18571 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[1].shape;
18572 if (unlikely(__pyx_t_51 < 0)) __pyx_t_15 = 1;
18573 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18574 if (__pyx_t_52 < 0) {
18575 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[2].shape;
18576 if (unlikely(__pyx_t_52 < 0)) __pyx_t_15 = 2;
18577 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18578 if (__pyx_t_53 < 0) {
18579 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[3].shape;
18580 if (unlikely(__pyx_t_53 < 0)) __pyx_t_15 = 3;
18581 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18582 if (unlikely(__pyx_t_15 != -1)) {
18583 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18584 __PYX_ERR(0, 841, __pyx_L1_error)
18586 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_49, __pyx_pybuffernd_x.diminfo[3].strides))));
18595 __pyx_t_54 = __pyx_v_eN;
18596 __pyx_t_55 = __pyx_v_ebN;
18597 __pyx_t_56 = __pyx_v_k;
18600 if (__pyx_t_54 < 0) {
18601 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[0].shape;
18602 if (unlikely(__pyx_t_54 < 0)) __pyx_t_15 = 0;
18603 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18604 if (__pyx_t_55 < 0) {
18605 __pyx_t_55 += __pyx_pybuffernd_v.diminfo[1].shape;
18606 if (unlikely(__pyx_t_55 < 0)) __pyx_t_15 = 1;
18607 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18608 if (__pyx_t_56 < 0) {
18609 __pyx_t_56 += __pyx_pybuffernd_v.diminfo[2].shape;
18610 if (unlikely(__pyx_t_56 < 0)) __pyx_t_15 = 2;
18611 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18612 if (__pyx_t_57 < 0) {
18613 __pyx_t_57 += __pyx_pybuffernd_v.diminfo[3].shape;
18614 if (unlikely(__pyx_t_57 < 0)) __pyx_t_15 = 3;
18615 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18616 if (unlikely(__pyx_t_15 != -1)) {
18617 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18618 __PYX_ERR(0, 842, __pyx_L1_error)
18620 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_57, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18645 #ifndef CYTHON_WITHOUT_ASSERTIONS
18646 if (unlikely(!Py_OptimizeFlag)) {
18647 if (unlikely(!(((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 2) != 0))) {
18648 PyErr_SetNone(PyExc_AssertionError);
18649 __PYX_ERR(0, 844, __pyx_L1_error)
18661 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18671 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18672 __pyx_t_3 = __pyx_t_2;
18673 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18674 __pyx_v_eN = __pyx_t_4;
18683 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18684 __pyx_t_6 = __pyx_t_5;
18685 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18686 __pyx_v_ebN = __pyx_t_7;
18695 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18696 __pyx_t_9 = __pyx_t_8;
18697 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18698 __pyx_v_k = __pyx_t_10;
18707 __pyx_t_58 = __pyx_v_eN;
18708 __pyx_t_59 = __pyx_v_ebN;
18709 __pyx_t_60 = __pyx_v_k;
18712 if (__pyx_t_58 < 0) {
18713 __pyx_t_58 += __pyx_pybuffernd_x.diminfo[0].shape;
18714 if (unlikely(__pyx_t_58 < 0)) __pyx_t_15 = 0;
18715 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18716 if (__pyx_t_59 < 0) {
18717 __pyx_t_59 += __pyx_pybuffernd_x.diminfo[1].shape;
18718 if (unlikely(__pyx_t_59 < 0)) __pyx_t_15 = 1;
18719 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18720 if (__pyx_t_60 < 0) {
18721 __pyx_t_60 += __pyx_pybuffernd_x.diminfo[2].shape;
18722 if (unlikely(__pyx_t_60 < 0)) __pyx_t_15 = 2;
18723 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18724 if (__pyx_t_61 < 0) {
18725 __pyx_t_61 += __pyx_pybuffernd_x.diminfo[3].shape;
18726 if (unlikely(__pyx_t_61 < 0)) __pyx_t_15 = 3;
18727 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18728 if (unlikely(__pyx_t_15 != -1)) {
18729 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18730 __PYX_ERR(0, 849, __pyx_L1_error)
18732 __pyx_t_62 = __pyx_v_eN;
18733 __pyx_t_63 = __pyx_v_ebN;
18734 __pyx_t_64 = __pyx_v_k;
18737 if (__pyx_t_62 < 0) {
18738 __pyx_t_62 += __pyx_pybuffernd_v.diminfo[0].shape;
18739 if (unlikely(__pyx_t_62 < 0)) __pyx_t_15 = 0;
18740 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18741 if (__pyx_t_63 < 0) {
18742 __pyx_t_63 += __pyx_pybuffernd_v.diminfo[1].shape;
18743 if (unlikely(__pyx_t_63 < 0)) __pyx_t_15 = 1;
18744 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18745 if (__pyx_t_64 < 0) {
18746 __pyx_t_64 += __pyx_pybuffernd_v.diminfo[2].shape;
18747 if (unlikely(__pyx_t_64 < 0)) __pyx_t_15 = 2;
18748 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18749 if (__pyx_t_65 < 0) {
18750 __pyx_t_65 += __pyx_pybuffernd_v.diminfo[3].shape;
18751 if (unlikely(__pyx_t_65 < 0)) __pyx_t_15 = 3;
18752 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18753 if (unlikely(__pyx_t_15 != -1)) {
18754 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18755 __PYX_ERR(0, 849, __pyx_L1_error)
18757 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_63, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_64, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_65, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_61, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18766 __pyx_t_66 = __pyx_v_eN;
18767 __pyx_t_67 = __pyx_v_ebN;
18768 __pyx_t_68 = __pyx_v_k;
18771 if (__pyx_t_66 < 0) {
18772 __pyx_t_66 += __pyx_pybuffernd_x.diminfo[0].shape;
18773 if (unlikely(__pyx_t_66 < 0)) __pyx_t_15 = 0;
18774 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18775 if (__pyx_t_67 < 0) {
18776 __pyx_t_67 += __pyx_pybuffernd_x.diminfo[1].shape;
18777 if (unlikely(__pyx_t_67 < 0)) __pyx_t_15 = 1;
18778 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18779 if (__pyx_t_68 < 0) {
18780 __pyx_t_68 += __pyx_pybuffernd_x.diminfo[2].shape;
18781 if (unlikely(__pyx_t_68 < 0)) __pyx_t_15 = 2;
18782 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18783 if (__pyx_t_69 < 0) {
18784 __pyx_t_69 += __pyx_pybuffernd_x.diminfo[3].shape;
18785 if (unlikely(__pyx_t_69 < 0)) __pyx_t_15 = 3;
18786 }
else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18787 if (unlikely(__pyx_t_15 != -1)) {
18788 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18789 __PYX_ERR(0, 850, __pyx_L1_error)
18791 __pyx_t_70 = __pyx_v_eN;
18792 __pyx_t_71 = __pyx_v_ebN;
18793 __pyx_t_72 = __pyx_v_k;
18796 if (__pyx_t_70 < 0) {
18797 __pyx_t_70 += __pyx_pybuffernd_v.diminfo[0].shape;
18798 if (unlikely(__pyx_t_70 < 0)) __pyx_t_15 = 0;
18799 }
else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18800 if (__pyx_t_71 < 0) {
18801 __pyx_t_71 += __pyx_pybuffernd_v.diminfo[1].shape;
18802 if (unlikely(__pyx_t_71 < 0)) __pyx_t_15 = 1;
18803 }
else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18804 if (__pyx_t_72 < 0) {
18805 __pyx_t_72 += __pyx_pybuffernd_v.diminfo[2].shape;
18806 if (unlikely(__pyx_t_72 < 0)) __pyx_t_15 = 2;
18807 }
else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18808 if (__pyx_t_73 < 0) {
18809 __pyx_t_73 += __pyx_pybuffernd_v.diminfo[3].shape;
18810 if (unlikely(__pyx_t_73 < 0)) __pyx_t_15 = 3;
18811 }
else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18812 if (unlikely(__pyx_t_15 != -1)) {
18813 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18814 __PYX_ERR(0, 850, __pyx_L1_error)
18816 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_70, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_71, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_72, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_73, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_66, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_67, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_68, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_69, __pyx_pybuffernd_x.diminfo[3].strides))));
18825 __pyx_t_35 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 851, __pyx_L1_error)
18826 __Pyx_GOTREF(__pyx_t_35);
18827 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 851, __pyx_L1_error)
18828 __Pyx_GOTREF(__pyx_t_32);
18829 __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
18830 __Pyx_GOTREF(__pyx_t_33);
18831 __pyx_t_34 = PyTuple_New(4);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 851, __pyx_L1_error)
18832 __Pyx_GOTREF(__pyx_t_34);
18833 __Pyx_GIVEREF(__pyx_t_35);
18834 PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_35);
18835 __Pyx_GIVEREF(__pyx_t_32);
18836 PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_t_32);
18837 __Pyx_GIVEREF(__pyx_t_33);
18838 PyTuple_SET_ITEM(__pyx_t_34, 2, __pyx_t_33);
18839 __Pyx_INCREF(__pyx_slice__6);
18840 __Pyx_GIVEREF(__pyx_slice__6);
18841 PyTuple_SET_ITEM(__pyx_t_34, 3, __pyx_slice__6);
18845 __pyx_t_33 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_34);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 851, __pyx_L1_error)
18846 __Pyx_GOTREF(__pyx_t_33);
18847 __pyx_t_37 = (__pyx_v_tForReversal - __pyx_v_t);
18848 __pyx_t_36 = (__pyx_v_tForReversal - 0.0);
18849 if (unlikely(__pyx_t_36 == 0)) {
18850 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18851 __PYX_ERR(0, 851, __pyx_L1_error)
18853 __pyx_t_32 = PyFloat_FromDouble(((__pyx_t_37 / __pyx_t_36) * __pyx_v_clock));
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 851, __pyx_L1_error)
18854 __Pyx_GOTREF(__pyx_t_32);
18855 __pyx_t_35 = PyNumber_InPlaceMultiply(__pyx_t_33, __pyx_t_32);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 851, __pyx_L1_error)
18856 __Pyx_GOTREF(__pyx_t_35);
18857 __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
18858 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
18859 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_34, __pyx_t_35) < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
18860 __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
18861 __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
18884 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18885 __pyx_t_3 = __pyx_t_2;
18886 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18887 __pyx_v_eN = __pyx_t_4;
18896 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18897 __pyx_t_6 = __pyx_t_5;
18898 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18899 __pyx_v_ebN = __pyx_t_7;
18908 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18909 __pyx_t_9 = __pyx_t_8;
18910 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18911 __pyx_v_k = __pyx_t_10;
18920 __pyx_t_74 = __pyx_v_eN;
18921 __pyx_t_75 = __pyx_v_ebN;
18922 __pyx_t_76 = __pyx_v_k;
18925 if (__pyx_t_74 < 0) {
18926 __pyx_t_74 += __pyx_pybuffernd_x.diminfo[0].shape;
18927 if (unlikely(__pyx_t_74 < 0)) __pyx_t_15 = 0;
18928 }
else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18929 if (__pyx_t_75 < 0) {
18930 __pyx_t_75 += __pyx_pybuffernd_x.diminfo[1].shape;
18931 if (unlikely(__pyx_t_75 < 0)) __pyx_t_15 = 1;
18932 }
else if (unlikely(__pyx_t_75 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18933 if (__pyx_t_76 < 0) {
18934 __pyx_t_76 += __pyx_pybuffernd_x.diminfo[2].shape;
18935 if (unlikely(__pyx_t_76 < 0)) __pyx_t_15 = 2;
18936 }
else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18937 if (__pyx_t_77 < 0) {
18938 __pyx_t_77 += __pyx_pybuffernd_x.diminfo[3].shape;
18939 if (unlikely(__pyx_t_77 < 0)) __pyx_t_15 = 3;
18940 }
else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18941 if (unlikely(__pyx_t_15 != -1)) {
18942 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18943 __PYX_ERR(0, 856, __pyx_L1_error)
18945 __pyx_t_78 = __pyx_v_eN;
18946 __pyx_t_79 = __pyx_v_ebN;
18947 __pyx_t_80 = __pyx_v_k;
18950 if (__pyx_t_78 < 0) {
18951 __pyx_t_78 += __pyx_pybuffernd_v.diminfo[0].shape;
18952 if (unlikely(__pyx_t_78 < 0)) __pyx_t_15 = 0;
18953 }
else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18954 if (__pyx_t_79 < 0) {
18955 __pyx_t_79 += __pyx_pybuffernd_v.diminfo[1].shape;
18956 if (unlikely(__pyx_t_79 < 0)) __pyx_t_15 = 1;
18957 }
else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18958 if (__pyx_t_80 < 0) {
18959 __pyx_t_80 += __pyx_pybuffernd_v.diminfo[2].shape;
18960 if (unlikely(__pyx_t_80 < 0)) __pyx_t_15 = 2;
18961 }
else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18962 if (__pyx_t_81 < 0) {
18963 __pyx_t_81 += __pyx_pybuffernd_v.diminfo[3].shape;
18964 if (unlikely(__pyx_t_81 < 0)) __pyx_t_15 = 3;
18965 }
else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18966 if (unlikely(__pyx_t_15 != -1)) {
18967 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18968 __PYX_ERR(0, 856, __pyx_L1_error)
18970 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_78, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_79, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_80, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_81, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_74, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_75, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_76, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_77, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18979 __pyx_t_82 = __pyx_v_eN;
18980 __pyx_t_83 = __pyx_v_ebN;
18981 __pyx_t_84 = __pyx_v_k;
18984 if (__pyx_t_82 < 0) {
18985 __pyx_t_82 += __pyx_pybuffernd_x.diminfo[0].shape;
18986 if (unlikely(__pyx_t_82 < 0)) __pyx_t_15 = 0;
18987 }
else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18988 if (__pyx_t_83 < 0) {
18989 __pyx_t_83 += __pyx_pybuffernd_x.diminfo[1].shape;
18990 if (unlikely(__pyx_t_83 < 0)) __pyx_t_15 = 1;
18991 }
else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18992 if (__pyx_t_84 < 0) {
18993 __pyx_t_84 += __pyx_pybuffernd_x.diminfo[2].shape;
18994 if (unlikely(__pyx_t_84 < 0)) __pyx_t_15 = 2;
18995 }
else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18996 if (__pyx_t_85 < 0) {
18997 __pyx_t_85 += __pyx_pybuffernd_x.diminfo[3].shape;
18998 if (unlikely(__pyx_t_85 < 0)) __pyx_t_15 = 3;
18999 }
else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19000 if (unlikely(__pyx_t_15 != -1)) {
19001 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19002 __PYX_ERR(0, 857, __pyx_L1_error)
19004 __pyx_t_86 = __pyx_v_eN;
19005 __pyx_t_87 = __pyx_v_ebN;
19006 __pyx_t_88 = __pyx_v_k;
19009 if (__pyx_t_86 < 0) {
19010 __pyx_t_86 += __pyx_pybuffernd_v.diminfo[0].shape;
19011 if (unlikely(__pyx_t_86 < 0)) __pyx_t_15 = 0;
19012 }
else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19013 if (__pyx_t_87 < 0) {
19014 __pyx_t_87 += __pyx_pybuffernd_v.diminfo[1].shape;
19015 if (unlikely(__pyx_t_87 < 0)) __pyx_t_15 = 1;
19016 }
else if (unlikely(__pyx_t_87 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19017 if (__pyx_t_88 < 0) {
19018 __pyx_t_88 += __pyx_pybuffernd_v.diminfo[2].shape;
19019 if (unlikely(__pyx_t_88 < 0)) __pyx_t_15 = 2;
19020 }
else if (unlikely(__pyx_t_88 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19021 if (__pyx_t_89 < 0) {
19022 __pyx_t_89 += __pyx_pybuffernd_v.diminfo[3].shape;
19023 if (unlikely(__pyx_t_89 < 0)) __pyx_t_15 = 3;
19024 }
else if (unlikely(__pyx_t_89 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19025 if (unlikely(__pyx_t_15 != -1)) {
19026 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19027 __PYX_ERR(0, 857, __pyx_L1_error)
19029 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_86, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_87, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_88, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_89, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_82, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_83, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_84, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_85, __pyx_pybuffernd_x.diminfo[3].strides))));
19047 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19050 __Pyx_XDECREF(__pyx_t_32);
19051 __Pyx_XDECREF(__pyx_t_33);
19052 __Pyx_XDECREF(__pyx_t_34);
19053 __Pyx_XDECREF(__pyx_t_35);
19054 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19055 __Pyx_PyThreadState_declare
19056 __Pyx_PyThreadState_assign
19057 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19058 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19059 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19060 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19061 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19065 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19066 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19068 __Pyx_XGIVEREF(__pyx_r);
19069 __Pyx_RefNannyFinishContext();
19082 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19083 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
19084 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19085 int __pyx_v_transient;
19087 double __pyx_v_tForReversal;
19088 double __pyx_v_clock;
19089 double __pyx_v_zVelocity;
19092 PyArrayObject *__pyx_v_x = 0;
19093 PyArrayObject *__pyx_v_v = 0;
19094 PyObject *__pyx_r = 0;
19095 __Pyx_RefNannyDeclarations
19096 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
19098 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19099 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19100 if (unlikely(__pyx_kwds)) {
19101 Py_ssize_t kw_args;
19102 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19103 switch (pos_args) {
19104 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19105 CYTHON_FALLTHROUGH;
19106 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19107 CYTHON_FALLTHROUGH;
19108 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19109 CYTHON_FALLTHROUGH;
19110 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19111 CYTHON_FALLTHROUGH;
19112 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19113 CYTHON_FALLTHROUGH;
19114 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19115 CYTHON_FALLTHROUGH;
19116 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19117 CYTHON_FALLTHROUGH;
19118 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19119 CYTHON_FALLTHROUGH;
19120 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19121 CYTHON_FALLTHROUGH;
19123 default:
goto __pyx_L5_argtuple_error;
19125 kw_args = PyDict_Size(__pyx_kwds);
19126 switch (pos_args) {
19128 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19129 else goto __pyx_L5_argtuple_error;
19130 CYTHON_FALLTHROUGH;
19132 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19134 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); __PYX_ERR(0, 859, __pyx_L3_error)
19136 CYTHON_FALLTHROUGH;
19138 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19140 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); __PYX_ERR(0, 859, __pyx_L3_error)
19142 CYTHON_FALLTHROUGH;
19144 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19146 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); __PYX_ERR(0, 859, __pyx_L3_error)
19148 CYTHON_FALLTHROUGH;
19150 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19152 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); __PYX_ERR(0, 859, __pyx_L3_error)
19154 CYTHON_FALLTHROUGH;
19156 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19158 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); __PYX_ERR(0, 859, __pyx_L3_error)
19160 CYTHON_FALLTHROUGH;
19162 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19164 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); __PYX_ERR(0, 859, __pyx_L3_error)
19166 CYTHON_FALLTHROUGH;
19168 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19170 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); __PYX_ERR(0, 859, __pyx_L3_error)
19172 CYTHON_FALLTHROUGH;
19174 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19176 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); __PYX_ERR(0, 859, __pyx_L3_error)
19179 if (unlikely(kw_args > 0)) {
19180 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
19182 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19183 goto __pyx_L5_argtuple_error;
19185 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19186 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19187 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19188 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19189 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19190 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19191 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19192 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19193 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19195 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L3_error)
19196 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
19197 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
19198 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
19199 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
19200 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19201 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19202 __pyx_v_x = ((PyArrayObject *)values[7]);
19203 __pyx_v_v = ((PyArrayObject *)values[8]);
19205 goto __pyx_L4_argument_unpacking_done;
19206 __pyx_L5_argtuple_error:;
19207 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
19209 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19210 __Pyx_RefNannyFinishContext();
19212 __pyx_L4_argument_unpacking_done:;
19213 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
19214 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
19215 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19222 __Pyx_RefNannyFinishContext();
19226 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19230 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19231 __Pyx_Buffer __pyx_pybuffer_v;
19232 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19233 __Pyx_Buffer __pyx_pybuffer_x;
19234 PyObject *__pyx_r = NULL;
19235 __Pyx_RefNannyDeclarations
19237 npy_intp __pyx_t_2;
19238 npy_intp __pyx_t_3;
19240 npy_intp __pyx_t_5;
19241 npy_intp __pyx_t_6;
19243 Py_ssize_t __pyx_t_8;
19244 Py_ssize_t __pyx_t_9;
19245 Py_ssize_t __pyx_t_10;
19247 Py_ssize_t __pyx_t_12;
19248 Py_ssize_t __pyx_t_13;
19249 Py_ssize_t __pyx_t_14;
19250 Py_ssize_t __pyx_t_15;
19251 Py_ssize_t __pyx_t_16;
19252 Py_ssize_t __pyx_t_17;
19253 Py_ssize_t __pyx_t_18;
19254 Py_ssize_t __pyx_t_19;
19255 Py_ssize_t __pyx_t_20;
19256 Py_ssize_t __pyx_t_21;
19257 Py_ssize_t __pyx_t_22;
19258 Py_ssize_t __pyx_t_23;
19259 PyObject *__pyx_t_24 = NULL;
19260 PyObject *__pyx_t_25 = NULL;
19261 PyObject *__pyx_t_26 = NULL;
19264 PyObject *__pyx_t_29 = NULL;
19265 Py_ssize_t __pyx_t_30;
19266 Py_ssize_t __pyx_t_31;
19267 Py_ssize_t __pyx_t_32;
19268 Py_ssize_t __pyx_t_33;
19269 Py_ssize_t __pyx_t_34;
19270 Py_ssize_t __pyx_t_35;
19271 Py_ssize_t __pyx_t_36;
19272 Py_ssize_t __pyx_t_37;
19273 Py_ssize_t __pyx_t_38;
19274 Py_ssize_t __pyx_t_39;
19275 Py_ssize_t __pyx_t_40;
19276 Py_ssize_t __pyx_t_41;
19277 Py_ssize_t __pyx_t_42;
19278 Py_ssize_t __pyx_t_43;
19279 Py_ssize_t __pyx_t_44;
19280 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
19281 __pyx_pybuffer_x.pybuffer.buf = NULL;
19282 __pyx_pybuffer_x.refcount = 0;
19283 __pyx_pybuffernd_x.data = NULL;
19284 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19285 __pyx_pybuffer_v.pybuffer.buf = NULL;
19286 __pyx_pybuffer_v.refcount = 0;
19287 __pyx_pybuffernd_v.data = NULL;
19288 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19290 __Pyx_BufFmt_StackElem __pyx_stack[1];
19291 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19293 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19295 __Pyx_BufFmt_StackElem __pyx_stack[1];
19296 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19298 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19316 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19326 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19327 __pyx_t_3 = __pyx_t_2;
19328 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19329 __pyx_v_eN = __pyx_t_4;
19338 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19339 __pyx_t_6 = __pyx_t_5;
19340 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19341 __pyx_v_k = __pyx_t_7;
19350 __pyx_t_8 = __pyx_v_eN;
19351 __pyx_t_9 = __pyx_v_k;
19354 if (__pyx_t_8 < 0) {
19355 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19356 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19357 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19358 if (__pyx_t_9 < 0) {
19359 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19360 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19361 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19362 if (__pyx_t_10 < 0) {
19363 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19364 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19365 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19366 if (unlikely(__pyx_t_11 != -1)) {
19367 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19368 __PYX_ERR(0, 873, __pyx_L1_error)
19370 __pyx_t_12 = __pyx_v_eN;
19371 __pyx_t_13 = __pyx_v_k;
19374 if (__pyx_t_12 < 0) {
19375 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19376 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19377 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19378 if (__pyx_t_13 < 0) {
19379 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19380 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19381 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19382 if (__pyx_t_14 < 0) {
19383 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19384 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19385 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19386 if (unlikely(__pyx_t_11 != -1)) {
19387 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19388 __PYX_ERR(0, 873, __pyx_L1_error)
19390 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19399 __pyx_t_15 = __pyx_v_eN;
19400 __pyx_t_16 = __pyx_v_k;
19403 if (__pyx_t_15 < 0) {
19404 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
19405 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
19406 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19407 if (__pyx_t_16 < 0) {
19408 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
19409 if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 1;
19410 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19411 if (__pyx_t_17 < 0) {
19412 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
19413 if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 2;
19414 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19415 if (unlikely(__pyx_t_11 != -1)) {
19416 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19417 __PYX_ERR(0, 874, __pyx_L1_error)
19419 __pyx_t_18 = __pyx_v_eN;
19420 __pyx_t_19 = __pyx_v_k;
19423 if (__pyx_t_18 < 0) {
19424 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
19425 if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 0;
19426 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19427 if (__pyx_t_19 < 0) {
19428 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
19429 if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 1;
19430 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19431 if (__pyx_t_20 < 0) {
19432 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
19433 if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 2;
19434 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19435 if (unlikely(__pyx_t_11 != -1)) {
19436 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19437 __PYX_ERR(0, 874, __pyx_L1_error)
19439 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides))));
19448 __pyx_t_21 = __pyx_v_eN;
19449 __pyx_t_22 = __pyx_v_k;
19452 if (__pyx_t_21 < 0) {
19453 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
19454 if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0;
19455 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19456 if (__pyx_t_22 < 0) {
19457 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
19458 if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 1;
19459 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19460 if (__pyx_t_23 < 0) {
19461 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
19462 if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 2;
19463 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19464 if (unlikely(__pyx_t_11 != -1)) {
19465 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19466 __PYX_ERR(0, 875, __pyx_L1_error)
19468 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19477 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 876, __pyx_L1_error)
19478 __Pyx_GOTREF(__pyx_t_24);
19479 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 876, __pyx_L1_error)
19480 __Pyx_GOTREF(__pyx_t_25);
19481 __pyx_t_26 = PyTuple_New(3);
if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 876, __pyx_L1_error)
19482 __Pyx_GOTREF(__pyx_t_26);
19483 __Pyx_GIVEREF(__pyx_t_24);
19484 PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_24);
19485 __Pyx_GIVEREF(__pyx_t_25);
19486 PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_25);
19487 __Pyx_INCREF(__pyx_slice__7);
19488 __Pyx_GIVEREF(__pyx_slice__7);
19489 PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_slice__7);
19492 __pyx_t_25 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_26);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 876, __pyx_L1_error)
19493 __Pyx_GOTREF(__pyx_t_25);
19494 __pyx_t_27 = (__pyx_v_pi * __pyx_v_t);
19495 __pyx_t_28 = (__pyx_v_tForReversal * 2.0);
19496 if (unlikely(__pyx_t_28 == 0)) {
19497 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19498 __PYX_ERR(0, 876, __pyx_L1_error)
19500 __pyx_t_24 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_27 / __pyx_t_28))));
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 876, __pyx_L1_error)
19501 __Pyx_GOTREF(__pyx_t_24);
19502 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_25, __pyx_t_24);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 876, __pyx_L1_error)
19503 __Pyx_GOTREF(__pyx_t_29);
19504 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
19505 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
19506 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_26, __pyx_t_29) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
19507 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
19508 __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
19530 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19531 __pyx_t_3 = __pyx_t_2;
19532 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19533 __pyx_v_eN = __pyx_t_4;
19542 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19543 __pyx_t_6 = __pyx_t_5;
19544 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19545 __pyx_v_k = __pyx_t_7;
19554 __pyx_t_30 = __pyx_v_eN;
19555 __pyx_t_31 = __pyx_v_k;
19558 if (__pyx_t_30 < 0) {
19559 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[0].shape;
19560 if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 0;
19561 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19562 if (__pyx_t_31 < 0) {
19563 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[1].shape;
19564 if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 1;
19565 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19566 if (__pyx_t_32 < 0) {
19567 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[2].shape;
19568 if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 2;
19569 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19570 if (unlikely(__pyx_t_11 != -1)) {
19571 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19572 __PYX_ERR(0, 880, __pyx_L1_error)
19574 __pyx_t_33 = __pyx_v_eN;
19575 __pyx_t_34 = __pyx_v_k;
19578 if (__pyx_t_33 < 0) {
19579 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[0].shape;
19580 if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 0;
19581 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19582 if (__pyx_t_34 < 0) {
19583 __pyx_t_34 += __pyx_pybuffernd_v.diminfo[1].shape;
19584 if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 1;
19585 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19586 if (__pyx_t_35 < 0) {
19587 __pyx_t_35 += __pyx_pybuffernd_v.diminfo[2].shape;
19588 if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 2;
19589 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19590 if (unlikely(__pyx_t_11 != -1)) {
19591 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19592 __PYX_ERR(0, 880, __pyx_L1_error)
19594 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19603 __pyx_t_36 = __pyx_v_eN;
19604 __pyx_t_37 = __pyx_v_k;
19607 if (__pyx_t_36 < 0) {
19608 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[0].shape;
19609 if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0;
19610 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19611 if (__pyx_t_37 < 0) {
19612 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[1].shape;
19613 if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 1;
19614 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19615 if (__pyx_t_38 < 0) {
19616 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[2].shape;
19617 if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 2;
19618 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19619 if (unlikely(__pyx_t_11 != -1)) {
19620 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19621 __PYX_ERR(0, 881, __pyx_L1_error)
19623 __pyx_t_39 = __pyx_v_eN;
19624 __pyx_t_40 = __pyx_v_k;
19627 if (__pyx_t_39 < 0) {
19628 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
19629 if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0;
19630 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19631 if (__pyx_t_40 < 0) {
19632 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
19633 if (unlikely(__pyx_t_40 < 0)) __pyx_t_11 = 1;
19634 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19635 if (__pyx_t_41 < 0) {
19636 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
19637 if (unlikely(__pyx_t_41 < 0)) __pyx_t_11 = 2;
19638 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19639 if (unlikely(__pyx_t_11 != -1)) {
19640 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19641 __PYX_ERR(0, 881, __pyx_L1_error)
19643 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[2].strides))));
19652 __pyx_t_42 = __pyx_v_eN;
19653 __pyx_t_43 = __pyx_v_k;
19656 if (__pyx_t_42 < 0) {
19657 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
19658 if (unlikely(__pyx_t_42 < 0)) __pyx_t_11 = 0;
19659 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19660 if (__pyx_t_43 < 0) {
19661 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
19662 if (unlikely(__pyx_t_43 < 0)) __pyx_t_11 = 1;
19663 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19664 if (__pyx_t_44 < 0) {
19665 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
19666 if (unlikely(__pyx_t_44 < 0)) __pyx_t_11 = 2;
19667 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19668 if (unlikely(__pyx_t_11 != -1)) {
19669 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19670 __PYX_ERR(0, 882, __pyx_L1_error)
19672 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19687 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19690 __Pyx_XDECREF(__pyx_t_24);
19691 __Pyx_XDECREF(__pyx_t_25);
19692 __Pyx_XDECREF(__pyx_t_26);
19693 __Pyx_XDECREF(__pyx_t_29);
19694 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19695 __Pyx_PyThreadState_declare
19696 __Pyx_PyThreadState_assign
19697 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19698 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19699 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19700 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19701 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19705 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19706 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19708 __Pyx_XGIVEREF(__pyx_r);
19709 __Pyx_RefNannyFinishContext();
19722 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19723 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
19724 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19725 int __pyx_v_transient;
19727 double __pyx_v_tForReversal;
19728 double __pyx_v_clock;
19729 double __pyx_v_zVelocity;
19732 PyArrayObject *__pyx_v_x = 0;
19733 PyArrayObject *__pyx_v_v = 0;
19734 PyObject *__pyx_r = 0;
19735 __Pyx_RefNannyDeclarations
19736 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
19738 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19739 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19740 if (unlikely(__pyx_kwds)) {
19741 Py_ssize_t kw_args;
19742 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19743 switch (pos_args) {
19744 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19745 CYTHON_FALLTHROUGH;
19746 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19747 CYTHON_FALLTHROUGH;
19748 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19749 CYTHON_FALLTHROUGH;
19750 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19751 CYTHON_FALLTHROUGH;
19752 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19753 CYTHON_FALLTHROUGH;
19754 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19755 CYTHON_FALLTHROUGH;
19756 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19757 CYTHON_FALLTHROUGH;
19758 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19759 CYTHON_FALLTHROUGH;
19760 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19761 CYTHON_FALLTHROUGH;
19763 default:
goto __pyx_L5_argtuple_error;
19765 kw_args = PyDict_Size(__pyx_kwds);
19766 switch (pos_args) {
19768 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19769 else goto __pyx_L5_argtuple_error;
19770 CYTHON_FALLTHROUGH;
19772 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19774 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); __PYX_ERR(0, 884, __pyx_L3_error)
19776 CYTHON_FALLTHROUGH;
19778 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19780 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); __PYX_ERR(0, 884, __pyx_L3_error)
19782 CYTHON_FALLTHROUGH;
19784 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19786 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); __PYX_ERR(0, 884, __pyx_L3_error)
19788 CYTHON_FALLTHROUGH;
19790 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19792 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); __PYX_ERR(0, 884, __pyx_L3_error)
19794 CYTHON_FALLTHROUGH;
19796 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19798 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); __PYX_ERR(0, 884, __pyx_L3_error)
19800 CYTHON_FALLTHROUGH;
19802 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19804 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); __PYX_ERR(0, 884, __pyx_L3_error)
19806 CYTHON_FALLTHROUGH;
19808 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19810 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); __PYX_ERR(0, 884, __pyx_L3_error)
19812 CYTHON_FALLTHROUGH;
19814 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19816 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); __PYX_ERR(0, 884, __pyx_L3_error)
19819 if (unlikely(kw_args > 0)) {
19820 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
19822 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19823 goto __pyx_L5_argtuple_error;
19825 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19826 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19827 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19828 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19829 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19830 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19831 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19832 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19833 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19835 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
19836 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
19837 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
19838 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
19839 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
19840 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19841 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19842 __pyx_v_x = ((PyArrayObject *)values[7]);
19843 __pyx_v_v = ((PyArrayObject *)values[8]);
19845 goto __pyx_L4_argument_unpacking_done;
19846 __pyx_L5_argtuple_error:;
19847 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
19849 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19850 __Pyx_RefNannyFinishContext();
19852 __pyx_L4_argument_unpacking_done:;
19853 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
19854 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
19855 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19862 __Pyx_RefNannyFinishContext();
19866 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19871 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19872 __Pyx_Buffer __pyx_pybuffer_v;
19873 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19874 __Pyx_Buffer __pyx_pybuffer_x;
19875 PyObject *__pyx_r = NULL;
19876 __Pyx_RefNannyDeclarations
19878 npy_intp __pyx_t_2;
19879 npy_intp __pyx_t_3;
19881 npy_intp __pyx_t_5;
19882 npy_intp __pyx_t_6;
19884 npy_intp __pyx_t_8;
19885 npy_intp __pyx_t_9;
19887 Py_ssize_t __pyx_t_11;
19888 Py_ssize_t __pyx_t_12;
19889 Py_ssize_t __pyx_t_13;
19890 Py_ssize_t __pyx_t_14;
19892 Py_ssize_t __pyx_t_16;
19893 Py_ssize_t __pyx_t_17;
19894 Py_ssize_t __pyx_t_18;
19895 Py_ssize_t __pyx_t_19;
19896 Py_ssize_t __pyx_t_20;
19897 Py_ssize_t __pyx_t_21;
19898 Py_ssize_t __pyx_t_22;
19899 Py_ssize_t __pyx_t_23;
19900 Py_ssize_t __pyx_t_24;
19901 Py_ssize_t __pyx_t_25;
19902 Py_ssize_t __pyx_t_26;
19903 Py_ssize_t __pyx_t_27;
19904 Py_ssize_t __pyx_t_28;
19905 Py_ssize_t __pyx_t_29;
19906 Py_ssize_t __pyx_t_30;
19907 Py_ssize_t __pyx_t_31;
19908 PyObject *__pyx_t_32 = NULL;
19909 PyObject *__pyx_t_33 = NULL;
19910 PyObject *__pyx_t_34 = NULL;
19911 PyObject *__pyx_t_35 = NULL;
19914 Py_ssize_t __pyx_t_38;
19915 Py_ssize_t __pyx_t_39;
19916 Py_ssize_t __pyx_t_40;
19917 Py_ssize_t __pyx_t_41;
19918 Py_ssize_t __pyx_t_42;
19919 Py_ssize_t __pyx_t_43;
19920 Py_ssize_t __pyx_t_44;
19921 Py_ssize_t __pyx_t_45;
19922 Py_ssize_t __pyx_t_46;
19923 Py_ssize_t __pyx_t_47;
19924 Py_ssize_t __pyx_t_48;
19925 Py_ssize_t __pyx_t_49;
19926 Py_ssize_t __pyx_t_50;
19927 Py_ssize_t __pyx_t_51;
19928 Py_ssize_t __pyx_t_52;
19929 Py_ssize_t __pyx_t_53;
19930 Py_ssize_t __pyx_t_54;
19931 Py_ssize_t __pyx_t_55;
19932 Py_ssize_t __pyx_t_56;
19933 Py_ssize_t __pyx_t_57;
19934 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
19935 __pyx_pybuffer_x.pybuffer.buf = NULL;
19936 __pyx_pybuffer_x.refcount = 0;
19937 __pyx_pybuffernd_x.data = NULL;
19938 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19939 __pyx_pybuffer_v.pybuffer.buf = NULL;
19940 __pyx_pybuffer_v.refcount = 0;
19941 __pyx_pybuffernd_v.data = NULL;
19942 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19944 __Pyx_BufFmt_StackElem __pyx_stack[1];
19945 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19947 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19949 __Pyx_BufFmt_StackElem __pyx_stack[1];
19950 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19952 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19970 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19980 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19981 __pyx_t_3 = __pyx_t_2;
19982 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19983 __pyx_v_eN = __pyx_t_4;
19992 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19993 __pyx_t_6 = __pyx_t_5;
19994 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19995 __pyx_v_ebN = __pyx_t_7;
20004 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
20005 __pyx_t_9 = __pyx_t_8;
20006 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
20007 __pyx_v_k = __pyx_t_10;
20016 __pyx_t_11 = __pyx_v_eN;
20017 __pyx_t_12 = __pyx_v_ebN;
20018 __pyx_t_13 = __pyx_v_k;
20021 if (__pyx_t_11 < 0) {
20022 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20023 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
20024 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20025 if (__pyx_t_12 < 0) {
20026 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20027 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
20028 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20029 if (__pyx_t_13 < 0) {
20030 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20031 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
20032 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20033 if (__pyx_t_14 < 0) {
20034 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
20035 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
20036 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20037 if (unlikely(__pyx_t_15 != -1)) {
20038 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20039 __PYX_ERR(0, 899, __pyx_L1_error)
20041 __pyx_t_16 = __pyx_v_eN;
20042 __pyx_t_17 = __pyx_v_ebN;
20043 __pyx_t_18 = __pyx_v_k;
20046 if (__pyx_t_16 < 0) {
20047 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
20048 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
20049 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20050 if (__pyx_t_17 < 0) {
20051 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
20052 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
20053 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20054 if (__pyx_t_18 < 0) {
20055 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
20056 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
20057 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20058 if (__pyx_t_19 < 0) {
20059 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
20060 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
20061 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20062 if (unlikely(__pyx_t_15 != -1)) {
20063 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20064 __PYX_ERR(0, 899, __pyx_L1_error)
20066 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20075 __pyx_t_20 = __pyx_v_eN;
20076 __pyx_t_21 = __pyx_v_ebN;
20077 __pyx_t_22 = __pyx_v_k;
20080 if (__pyx_t_20 < 0) {
20081 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
20082 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 0;
20083 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20084 if (__pyx_t_21 < 0) {
20085 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
20086 if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 1;
20087 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20088 if (__pyx_t_22 < 0) {
20089 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[2].shape;
20090 if (unlikely(__pyx_t_22 < 0)) __pyx_t_15 = 2;
20091 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20092 if (__pyx_t_23 < 0) {
20093 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[3].shape;
20094 if (unlikely(__pyx_t_23 < 0)) __pyx_t_15 = 3;
20095 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20096 if (unlikely(__pyx_t_15 != -1)) {
20097 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20098 __PYX_ERR(0, 900, __pyx_L1_error)
20100 __pyx_t_24 = __pyx_v_eN;
20101 __pyx_t_25 = __pyx_v_ebN;
20102 __pyx_t_26 = __pyx_v_k;
20105 if (__pyx_t_24 < 0) {
20106 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[0].shape;
20107 if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
20108 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20109 if (__pyx_t_25 < 0) {
20110 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
20111 if (unlikely(__pyx_t_25 < 0)) __pyx_t_15 = 1;
20112 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20113 if (__pyx_t_26 < 0) {
20114 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[2].shape;
20115 if (unlikely(__pyx_t_26 < 0)) __pyx_t_15 = 2;
20116 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20117 if (__pyx_t_27 < 0) {
20118 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[3].shape;
20119 if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 3;
20120 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20121 if (unlikely(__pyx_t_15 != -1)) {
20122 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20123 __PYX_ERR(0, 900, __pyx_L1_error)
20125 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_x.diminfo[3].strides))));
20134 __pyx_t_28 = __pyx_v_eN;
20135 __pyx_t_29 = __pyx_v_ebN;
20136 __pyx_t_30 = __pyx_v_k;
20139 if (__pyx_t_28 < 0) {
20140 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[0].shape;
20141 if (unlikely(__pyx_t_28 < 0)) __pyx_t_15 = 0;
20142 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20143 if (__pyx_t_29 < 0) {
20144 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[1].shape;
20145 if (unlikely(__pyx_t_29 < 0)) __pyx_t_15 = 1;
20146 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20147 if (__pyx_t_30 < 0) {
20148 __pyx_t_30 += __pyx_pybuffernd_v.diminfo[2].shape;
20149 if (unlikely(__pyx_t_30 < 0)) __pyx_t_15 = 2;
20150 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20151 if (__pyx_t_31 < 0) {
20152 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[3].shape;
20153 if (unlikely(__pyx_t_31 < 0)) __pyx_t_15 = 3;
20154 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20155 if (unlikely(__pyx_t_15 != -1)) {
20156 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20157 __PYX_ERR(0, 901, __pyx_L1_error)
20159 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20168 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 902, __pyx_L1_error)
20169 __Pyx_GOTREF(__pyx_t_32);
20170 __pyx_t_33 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 902, __pyx_L1_error)
20171 __Pyx_GOTREF(__pyx_t_33);
20172 __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 902, __pyx_L1_error)
20173 __Pyx_GOTREF(__pyx_t_34);
20174 __pyx_t_35 = PyTuple_New(4);
if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 902, __pyx_L1_error)
20175 __Pyx_GOTREF(__pyx_t_35);
20176 __Pyx_GIVEREF(__pyx_t_32);
20177 PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_32);
20178 __Pyx_GIVEREF(__pyx_t_33);
20179 PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_33);
20180 __Pyx_GIVEREF(__pyx_t_34);
20181 PyTuple_SET_ITEM(__pyx_t_35, 2, __pyx_t_34);
20182 __Pyx_INCREF(__pyx_slice__8);
20183 __Pyx_GIVEREF(__pyx_slice__8);
20184 PyTuple_SET_ITEM(__pyx_t_35, 3, __pyx_slice__8);
20188 __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_35);
if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 902, __pyx_L1_error)
20189 __Pyx_GOTREF(__pyx_t_34);
20190 __pyx_t_36 = (__pyx_v_pi * __pyx_v_t);
20191 __pyx_t_37 = (__pyx_v_tForReversal * 2.0);
20192 if (unlikely(__pyx_t_37 == 0)) {
20193 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
20194 __PYX_ERR(0, 902, __pyx_L1_error)
20196 __pyx_t_33 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_36 / __pyx_t_37))));
if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 902, __pyx_L1_error)
20197 __Pyx_GOTREF(__pyx_t_33);
20198 __pyx_t_32 = PyNumber_InPlaceMultiply(__pyx_t_34, __pyx_t_33);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 902, __pyx_L1_error)
20199 __Pyx_GOTREF(__pyx_t_32);
20200 __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
20201 __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
20202 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_35, __pyx_t_32) < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
20203 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
20204 __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
20227 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
20228 __pyx_t_3 = __pyx_t_2;
20229 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20230 __pyx_v_eN = __pyx_t_4;
20239 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
20240 __pyx_t_6 = __pyx_t_5;
20241 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
20242 __pyx_v_ebN = __pyx_t_7;
20251 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
20252 __pyx_t_9 = __pyx_t_8;
20253 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
20254 __pyx_v_k = __pyx_t_10;
20263 __pyx_t_38 = __pyx_v_eN;
20264 __pyx_t_39 = __pyx_v_ebN;
20265 __pyx_t_40 = __pyx_v_k;
20268 if (__pyx_t_38 < 0) {
20269 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[0].shape;
20270 if (unlikely(__pyx_t_38 < 0)) __pyx_t_15 = 0;
20271 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20272 if (__pyx_t_39 < 0) {
20273 __pyx_t_39 += __pyx_pybuffernd_x.diminfo[1].shape;
20274 if (unlikely(__pyx_t_39 < 0)) __pyx_t_15 = 1;
20275 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20276 if (__pyx_t_40 < 0) {
20277 __pyx_t_40 += __pyx_pybuffernd_x.diminfo[2].shape;
20278 if (unlikely(__pyx_t_40 < 0)) __pyx_t_15 = 2;
20279 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20280 if (__pyx_t_41 < 0) {
20281 __pyx_t_41 += __pyx_pybuffernd_x.diminfo[3].shape;
20282 if (unlikely(__pyx_t_41 < 0)) __pyx_t_15 = 3;
20283 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20284 if (unlikely(__pyx_t_15 != -1)) {
20285 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20286 __PYX_ERR(0, 907, __pyx_L1_error)
20288 __pyx_t_42 = __pyx_v_eN;
20289 __pyx_t_43 = __pyx_v_ebN;
20290 __pyx_t_44 = __pyx_v_k;
20293 if (__pyx_t_42 < 0) {
20294 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[0].shape;
20295 if (unlikely(__pyx_t_42 < 0)) __pyx_t_15 = 0;
20296 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20297 if (__pyx_t_43 < 0) {
20298 __pyx_t_43 += __pyx_pybuffernd_v.diminfo[1].shape;
20299 if (unlikely(__pyx_t_43 < 0)) __pyx_t_15 = 1;
20300 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20301 if (__pyx_t_44 < 0) {
20302 __pyx_t_44 += __pyx_pybuffernd_v.diminfo[2].shape;
20303 if (unlikely(__pyx_t_44 < 0)) __pyx_t_15 = 2;
20304 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20305 if (__pyx_t_45 < 0) {
20306 __pyx_t_45 += __pyx_pybuffernd_v.diminfo[3].shape;
20307 if (unlikely(__pyx_t_45 < 0)) __pyx_t_15 = 3;
20308 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20309 if (unlikely(__pyx_t_15 != -1)) {
20310 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20311 __PYX_ERR(0, 907, __pyx_L1_error)
20313 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_45, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_41, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20322 __pyx_t_46 = __pyx_v_eN;
20323 __pyx_t_47 = __pyx_v_ebN;
20324 __pyx_t_48 = __pyx_v_k;
20327 if (__pyx_t_46 < 0) {
20328 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[0].shape;
20329 if (unlikely(__pyx_t_46 < 0)) __pyx_t_15 = 0;
20330 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20331 if (__pyx_t_47 < 0) {
20332 __pyx_t_47 += __pyx_pybuffernd_x.diminfo[1].shape;
20333 if (unlikely(__pyx_t_47 < 0)) __pyx_t_15 = 1;
20334 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20335 if (__pyx_t_48 < 0) {
20336 __pyx_t_48 += __pyx_pybuffernd_x.diminfo[2].shape;
20337 if (unlikely(__pyx_t_48 < 0)) __pyx_t_15 = 2;
20338 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20339 if (__pyx_t_49 < 0) {
20340 __pyx_t_49 += __pyx_pybuffernd_x.diminfo[3].shape;
20341 if (unlikely(__pyx_t_49 < 0)) __pyx_t_15 = 3;
20342 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20343 if (unlikely(__pyx_t_15 != -1)) {
20344 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20345 __PYX_ERR(0, 908, __pyx_L1_error)
20347 __pyx_t_50 = __pyx_v_eN;
20348 __pyx_t_51 = __pyx_v_ebN;
20349 __pyx_t_52 = __pyx_v_k;
20352 if (__pyx_t_50 < 0) {
20353 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[0].shape;
20354 if (unlikely(__pyx_t_50 < 0)) __pyx_t_15 = 0;
20355 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20356 if (__pyx_t_51 < 0) {
20357 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[1].shape;
20358 if (unlikely(__pyx_t_51 < 0)) __pyx_t_15 = 1;
20359 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20360 if (__pyx_t_52 < 0) {
20361 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[2].shape;
20362 if (unlikely(__pyx_t_52 < 0)) __pyx_t_15 = 2;
20363 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20364 if (__pyx_t_53 < 0) {
20365 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[3].shape;
20366 if (unlikely(__pyx_t_53 < 0)) __pyx_t_15 = 3;
20367 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20368 if (unlikely(__pyx_t_15 != -1)) {
20369 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20370 __PYX_ERR(0, 908, __pyx_L1_error)
20372 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_49, __pyx_pybuffernd_x.diminfo[3].strides))));
20381 __pyx_t_54 = __pyx_v_eN;
20382 __pyx_t_55 = __pyx_v_ebN;
20383 __pyx_t_56 = __pyx_v_k;
20386 if (__pyx_t_54 < 0) {
20387 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[0].shape;
20388 if (unlikely(__pyx_t_54 < 0)) __pyx_t_15 = 0;
20389 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20390 if (__pyx_t_55 < 0) {
20391 __pyx_t_55 += __pyx_pybuffernd_v.diminfo[1].shape;
20392 if (unlikely(__pyx_t_55 < 0)) __pyx_t_15 = 1;
20393 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20394 if (__pyx_t_56 < 0) {
20395 __pyx_t_56 += __pyx_pybuffernd_v.diminfo[2].shape;
20396 if (unlikely(__pyx_t_56 < 0)) __pyx_t_15 = 2;
20397 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20398 if (__pyx_t_57 < 0) {
20399 __pyx_t_57 += __pyx_pybuffernd_v.diminfo[3].shape;
20400 if (unlikely(__pyx_t_57 < 0)) __pyx_t_15 = 3;
20401 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20402 if (unlikely(__pyx_t_15 != -1)) {
20403 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20404 __PYX_ERR(0, 909, __pyx_L1_error)
20406 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_56, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_57, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20422 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20425 __Pyx_XDECREF(__pyx_t_32);
20426 __Pyx_XDECREF(__pyx_t_33);
20427 __Pyx_XDECREF(__pyx_t_34);
20428 __Pyx_XDECREF(__pyx_t_35);
20429 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20430 __Pyx_PyThreadState_declare
20431 __Pyx_PyThreadState_assign
20432 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20433 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20434 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20435 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20436 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20440 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20441 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20443 __Pyx_XGIVEREF(__pyx_r);
20444 __Pyx_RefNannyFinishContext();
20457 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20458 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
20459 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20461 PyArrayObject *__pyx_v_x = 0;
20462 PyArrayObject *__pyx_v_v = 0;
20463 PyObject *__pyx_r = 0;
20464 __Pyx_RefNannyDeclarations
20465 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
20467 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20468 PyObject* values[3] = {0,0,0};
20469 if (unlikely(__pyx_kwds)) {
20470 Py_ssize_t kw_args;
20471 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20472 switch (pos_args) {
20473 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20474 CYTHON_FALLTHROUGH;
20475 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20476 CYTHON_FALLTHROUGH;
20477 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20478 CYTHON_FALLTHROUGH;
20480 default:
goto __pyx_L5_argtuple_error;
20482 kw_args = PyDict_Size(__pyx_kwds);
20483 switch (pos_args) {
20485 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20486 else goto __pyx_L5_argtuple_error;
20487 CYTHON_FALLTHROUGH;
20489 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20491 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); __PYX_ERR(0, 911, __pyx_L3_error)
20493 CYTHON_FALLTHROUGH;
20495 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20497 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); __PYX_ERR(0, 911, __pyx_L3_error)
20500 if (unlikely(kw_args > 0)) {
20501 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
20503 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20504 goto __pyx_L5_argtuple_error;
20506 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20507 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20508 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20510 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
20511 __pyx_v_x = ((PyArrayObject *)values[1]);
20512 __pyx_v_v = ((PyArrayObject *)values[2]);
20514 goto __pyx_L4_argument_unpacking_done;
20515 __pyx_L5_argtuple_error:;
20516 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error)
20518 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20519 __Pyx_RefNannyFinishContext();
20521 __pyx_L4_argument_unpacking_done:;
20522 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
20523 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
20524 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20531 __Pyx_RefNannyFinishContext();
20535 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20539 double __pyx_v_one8;
20540 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20541 __Pyx_Buffer __pyx_pybuffer_v;
20542 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20543 __Pyx_Buffer __pyx_pybuffer_x;
20544 PyObject *__pyx_r = NULL;
20545 __Pyx_RefNannyDeclarations
20546 npy_intp __pyx_t_1;
20547 npy_intp __pyx_t_2;
20549 npy_intp __pyx_t_4;
20550 npy_intp __pyx_t_5;
20552 Py_ssize_t __pyx_t_7;
20553 Py_ssize_t __pyx_t_8;
20554 Py_ssize_t __pyx_t_9;
20556 Py_ssize_t __pyx_t_11;
20557 Py_ssize_t __pyx_t_12;
20558 Py_ssize_t __pyx_t_13;
20559 Py_ssize_t __pyx_t_14;
20560 Py_ssize_t __pyx_t_15;
20561 Py_ssize_t __pyx_t_16;
20562 Py_ssize_t __pyx_t_17;
20563 Py_ssize_t __pyx_t_18;
20564 Py_ssize_t __pyx_t_19;
20565 Py_ssize_t __pyx_t_20;
20566 Py_ssize_t __pyx_t_21;
20567 Py_ssize_t __pyx_t_22;
20568 Py_ssize_t __pyx_t_23;
20569 Py_ssize_t __pyx_t_24;
20570 Py_ssize_t __pyx_t_25;
20571 Py_ssize_t __pyx_t_26;
20572 Py_ssize_t __pyx_t_27;
20573 Py_ssize_t __pyx_t_28;
20574 Py_ssize_t __pyx_t_29;
20575 Py_ssize_t __pyx_t_30;
20576 Py_ssize_t __pyx_t_31;
20577 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
20578 __pyx_pybuffer_x.pybuffer.buf = NULL;
20579 __pyx_pybuffer_x.refcount = 0;
20580 __pyx_pybuffernd_x.data = NULL;
20581 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20582 __pyx_pybuffer_v.pybuffer.buf = NULL;
20583 __pyx_pybuffer_v.refcount = 0;
20584 __pyx_pybuffernd_v.data = NULL;
20585 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20587 __Pyx_BufFmt_StackElem __pyx_stack[1];
20588 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20590 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
20592 __Pyx_BufFmt_StackElem __pyx_stack[1];
20593 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20595 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
20613 __pyx_v_one8 = (1.0 / 8.0);
20622 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20623 __pyx_t_2 = __pyx_t_1;
20624 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20625 __pyx_v_eN = __pyx_t_3;
20634 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20635 __pyx_t_5 = __pyx_t_4;
20636 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20637 __pyx_v_k = __pyx_t_6;
20646 __pyx_t_7 = __pyx_v_eN;
20647 __pyx_t_8 = __pyx_v_k;
20650 if (__pyx_t_7 < 0) {
20651 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
20652 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 0;
20653 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20654 if (__pyx_t_8 < 0) {
20655 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20656 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20657 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20658 if (__pyx_t_9 < 0) {
20659 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
20660 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 2;
20661 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20662 if (unlikely(__pyx_t_10 != -1)) {
20663 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20664 __PYX_ERR(0, 920, __pyx_L1_error)
20666 __pyx_t_11 = __pyx_v_eN;
20667 __pyx_t_12 = __pyx_v_k;
20670 if (__pyx_t_11 < 0) {
20671 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20672 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20673 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20674 if (__pyx_t_12 < 0) {
20675 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20676 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20677 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20678 if (__pyx_t_13 < 0) {
20679 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20680 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 2;
20681 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20682 if (unlikely(__pyx_t_10 != -1)) {
20683 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20684 __PYX_ERR(0, 920, __pyx_L1_error)
20686 __pyx_t_14 = __pyx_v_eN;
20687 __pyx_t_15 = __pyx_v_k;
20690 if (__pyx_t_14 < 0) {
20691 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20692 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
20693 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20694 if (__pyx_t_15 < 0) {
20695 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20696 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20697 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20698 if (__pyx_t_16 < 0) {
20699 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20700 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 2;
20701 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20702 if (unlikely(__pyx_t_10 != -1)) {
20703 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20704 __PYX_ERR(0, 920, __pyx_L1_error)
20706 __pyx_t_17 = __pyx_v_eN;
20707 __pyx_t_18 = __pyx_v_k;
20710 if (__pyx_t_17 < 0) {
20711 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[0].shape;
20712 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
20713 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20714 if (__pyx_t_18 < 0) {
20715 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20716 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20717 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20718 if (__pyx_t_19 < 0) {
20719 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[2].shape;
20720 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 2;
20721 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20722 if (unlikely(__pyx_t_10 != -1)) {
20723 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20724 __PYX_ERR(0, 920, __pyx_L1_error)
20726 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides)))));
20735 __pyx_t_20 = __pyx_v_eN;
20736 __pyx_t_21 = __pyx_v_k;
20739 if (__pyx_t_20 < 0) {
20740 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[0].shape;
20741 if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
20742 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20743 if (__pyx_t_21 < 0) {
20744 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
20745 if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 1;
20746 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20747 if (__pyx_t_22 < 0) {
20748 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[2].shape;
20749 if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 2;
20750 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20751 if (unlikely(__pyx_t_10 != -1)) {
20752 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20753 __PYX_ERR(0, 921, __pyx_L1_error)
20755 __pyx_t_23 = __pyx_v_eN;
20756 __pyx_t_24 = __pyx_v_k;
20759 if (__pyx_t_23 < 0) {
20760 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[0].shape;
20761 if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0;
20762 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20763 if (__pyx_t_24 < 0) {
20764 __pyx_t_24 += __pyx_pybuffernd_x.diminfo[1].shape;
20765 if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 1;
20766 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20767 if (__pyx_t_25 < 0) {
20768 __pyx_t_25 += __pyx_pybuffernd_x.diminfo[2].shape;
20769 if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 2;
20770 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20771 if (unlikely(__pyx_t_10 != -1)) {
20772 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20773 __PYX_ERR(0, 921, __pyx_L1_error)
20775 __pyx_t_26 = __pyx_v_eN;
20776 __pyx_t_27 = __pyx_v_k;
20779 if (__pyx_t_26 < 0) {
20780 __pyx_t_26 += __pyx_pybuffernd_x.diminfo[0].shape;
20781 if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 0;
20782 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20783 if (__pyx_t_27 < 0) {
20784 __pyx_t_27 += __pyx_pybuffernd_x.diminfo[1].shape;
20785 if (unlikely(__pyx_t_27 < 0)) __pyx_t_10 = 1;
20786 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20787 if (__pyx_t_28 < 0) {
20788 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[2].shape;
20789 if (unlikely(__pyx_t_28 < 0)) __pyx_t_10 = 2;
20790 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20791 if (unlikely(__pyx_t_10 != -1)) {
20792 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20793 __PYX_ERR(0, 921, __pyx_L1_error)
20795 __pyx_t_29 = __pyx_v_eN;
20796 __pyx_t_30 = __pyx_v_k;
20799 if (__pyx_t_29 < 0) {
20800 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[0].shape;
20801 if (unlikely(__pyx_t_29 < 0)) __pyx_t_10 = 0;
20802 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20803 if (__pyx_t_30 < 0) {
20804 __pyx_t_30 += __pyx_pybuffernd_v.diminfo[1].shape;
20805 if (unlikely(__pyx_t_30 < 0)) __pyx_t_10 = 1;
20806 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20807 if (__pyx_t_31 < 0) {
20808 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[2].shape;
20809 if (unlikely(__pyx_t_31 < 0)) __pyx_t_10 = 2;
20810 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20811 if (unlikely(__pyx_t_10 != -1)) {
20812 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20813 __PYX_ERR(0, 921, __pyx_L1_error)
20815 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_x.diminfo[2].strides)))));
20828 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20831 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20832 __Pyx_PyThreadState_declare
20833 __Pyx_PyThreadState_assign
20834 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20835 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20836 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20837 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20838 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20843 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20845 __Pyx_XGIVEREF(__pyx_r);
20846 __Pyx_RefNannyFinishContext();
20859 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20860 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
20861 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20863 PyArrayObject *__pyx_v_x = 0;
20864 PyArrayObject *__pyx_v_v = 0;
20865 PyObject *__pyx_r = 0;
20866 __Pyx_RefNannyDeclarations
20867 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
20869 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20870 PyObject* values[3] = {0,0,0};
20871 if (unlikely(__pyx_kwds)) {
20872 Py_ssize_t kw_args;
20873 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20874 switch (pos_args) {
20875 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20876 CYTHON_FALLTHROUGH;
20877 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20878 CYTHON_FALLTHROUGH;
20879 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20880 CYTHON_FALLTHROUGH;
20882 default:
goto __pyx_L5_argtuple_error;
20884 kw_args = PyDict_Size(__pyx_kwds);
20885 switch (pos_args) {
20887 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20888 else goto __pyx_L5_argtuple_error;
20889 CYTHON_FALLTHROUGH;
20891 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20893 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); __PYX_ERR(0, 924, __pyx_L3_error)
20895 CYTHON_FALLTHROUGH;
20897 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20899 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); __PYX_ERR(0, 924, __pyx_L3_error)
20902 if (unlikely(kw_args > 0)) {
20903 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) __PYX_ERR(0, 924, __pyx_L3_error)
20905 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20906 goto __pyx_L5_argtuple_error;
20908 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20909 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20910 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20912 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L3_error)
20913 __pyx_v_x = ((PyArrayObject *)values[1]);
20914 __pyx_v_v = ((PyArrayObject *)values[2]);
20916 goto __pyx_L4_argument_unpacking_done;
20917 __pyx_L5_argtuple_error:;
20918 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error)
20920 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20921 __Pyx_RefNannyFinishContext();
20923 __pyx_L4_argument_unpacking_done:;
20924 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
20925 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
20926 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20933 __Pyx_RefNannyFinishContext();
20937 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20942 double __pyx_v_one8;
20943 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20944 __Pyx_Buffer __pyx_pybuffer_v;
20945 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20946 __Pyx_Buffer __pyx_pybuffer_x;
20947 PyObject *__pyx_r = NULL;
20948 __Pyx_RefNannyDeclarations
20949 npy_intp __pyx_t_1;
20950 npy_intp __pyx_t_2;
20952 npy_intp __pyx_t_4;
20953 npy_intp __pyx_t_5;
20955 npy_intp __pyx_t_7;
20956 npy_intp __pyx_t_8;
20958 Py_ssize_t __pyx_t_10;
20959 Py_ssize_t __pyx_t_11;
20960 Py_ssize_t __pyx_t_12;
20961 Py_ssize_t __pyx_t_13;
20963 Py_ssize_t __pyx_t_15;
20964 Py_ssize_t __pyx_t_16;
20965 Py_ssize_t __pyx_t_17;
20966 Py_ssize_t __pyx_t_18;
20967 Py_ssize_t __pyx_t_19;
20968 Py_ssize_t __pyx_t_20;
20969 Py_ssize_t __pyx_t_21;
20970 Py_ssize_t __pyx_t_22;
20971 Py_ssize_t __pyx_t_23;
20972 Py_ssize_t __pyx_t_24;
20973 Py_ssize_t __pyx_t_25;
20974 Py_ssize_t __pyx_t_26;
20975 Py_ssize_t __pyx_t_27;
20976 Py_ssize_t __pyx_t_28;
20977 Py_ssize_t __pyx_t_29;
20978 Py_ssize_t __pyx_t_30;
20979 Py_ssize_t __pyx_t_31;
20980 Py_ssize_t __pyx_t_32;
20981 Py_ssize_t __pyx_t_33;
20982 Py_ssize_t __pyx_t_34;
20983 Py_ssize_t __pyx_t_35;
20984 Py_ssize_t __pyx_t_36;
20985 Py_ssize_t __pyx_t_37;
20986 Py_ssize_t __pyx_t_38;
20987 Py_ssize_t __pyx_t_39;
20988 Py_ssize_t __pyx_t_40;
20989 Py_ssize_t __pyx_t_41;
20990 Py_ssize_t __pyx_t_42;
20991 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
20992 __pyx_pybuffer_x.pybuffer.buf = NULL;
20993 __pyx_pybuffer_x.refcount = 0;
20994 __pyx_pybuffernd_x.data = NULL;
20995 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20996 __pyx_pybuffer_v.pybuffer.buf = NULL;
20997 __pyx_pybuffer_v.refcount = 0;
20998 __pyx_pybuffernd_v.data = NULL;
20999 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
21001 __Pyx_BufFmt_StackElem __pyx_stack[1];
21002 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
21004 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
21006 __Pyx_BufFmt_StackElem __pyx_stack[1];
21007 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
21009 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
21027 __pyx_v_one8 = (1.0 / 8.0);
21036 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
21037 __pyx_t_2 = __pyx_t_1;
21038 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21039 __pyx_v_eN = __pyx_t_3;
21048 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
21049 __pyx_t_5 = __pyx_t_4;
21050 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21051 __pyx_v_ebN = __pyx_t_6;
21060 __pyx_t_7 = (__pyx_v_x->dimensions[2]);
21061 __pyx_t_8 = __pyx_t_7;
21062 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21063 __pyx_v_k = __pyx_t_9;
21072 __pyx_t_10 = __pyx_v_eN;
21073 __pyx_t_11 = __pyx_v_ebN;
21074 __pyx_t_12 = __pyx_v_k;
21077 if (__pyx_t_10 < 0) {
21078 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
21079 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 0;
21080 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21081 if (__pyx_t_11 < 0) {
21082 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[1].shape;
21083 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 1;
21084 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21085 if (__pyx_t_12 < 0) {
21086 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
21087 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 2;
21088 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21089 if (__pyx_t_13 < 0) {
21090 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[3].shape;
21091 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 3;
21092 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21093 if (unlikely(__pyx_t_14 != -1)) {
21094 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21095 __PYX_ERR(0, 934, __pyx_L1_error)
21097 __pyx_t_15 = __pyx_v_eN;
21098 __pyx_t_16 = __pyx_v_ebN;
21099 __pyx_t_17 = __pyx_v_k;
21102 if (__pyx_t_15 < 0) {
21103 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
21104 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
21105 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21106 if (__pyx_t_16 < 0) {
21107 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
21108 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
21109 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21110 if (__pyx_t_17 < 0) {
21111 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
21112 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 2;
21113 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21114 if (__pyx_t_18 < 0) {
21115 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[3].shape;
21116 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 3;
21117 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21118 if (unlikely(__pyx_t_14 != -1)) {
21119 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21120 __PYX_ERR(0, 934, __pyx_L1_error)
21122 __pyx_t_19 = __pyx_v_eN;
21123 __pyx_t_20 = __pyx_v_ebN;
21124 __pyx_t_21 = __pyx_v_k;
21127 if (__pyx_t_19 < 0) {
21128 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
21129 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
21130 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21131 if (__pyx_t_20 < 0) {
21132 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[1].shape;
21133 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 1;
21134 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21135 if (__pyx_t_21 < 0) {
21136 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[2].shape;
21137 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
21138 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21139 if (__pyx_t_22 < 0) {
21140 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[3].shape;
21141 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 3;
21142 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21143 if (unlikely(__pyx_t_14 != -1)) {
21144 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21145 __PYX_ERR(0, 934, __pyx_L1_error)
21147 __pyx_t_23 = __pyx_v_eN;
21148 __pyx_t_24 = __pyx_v_ebN;
21149 __pyx_t_25 = __pyx_v_k;
21152 if (__pyx_t_23 < 0) {
21153 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
21154 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
21155 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21156 if (__pyx_t_24 < 0) {
21157 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[1].shape;
21158 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
21159 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21160 if (__pyx_t_25 < 0) {
21161 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[2].shape;
21162 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
21163 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21164 if (__pyx_t_26 < 0) {
21165 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[3].shape;
21166 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 3;
21167 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21168 if (unlikely(__pyx_t_14 != -1)) {
21169 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21170 __PYX_ERR(0, 934, __pyx_L1_error)
21172 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[3].strides)))));
21181 __pyx_t_27 = __pyx_v_eN;
21182 __pyx_t_28 = __pyx_v_ebN;
21183 __pyx_t_29 = __pyx_v_k;
21186 if (__pyx_t_27 < 0) {
21187 __pyx_t_27 += __pyx_pybuffernd_x.diminfo[0].shape;
21188 if (unlikely(__pyx_t_27 < 0)) __pyx_t_14 = 0;
21189 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21190 if (__pyx_t_28 < 0) {
21191 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[1].shape;
21192 if (unlikely(__pyx_t_28 < 0)) __pyx_t_14 = 1;
21193 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21194 if (__pyx_t_29 < 0) {
21195 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[2].shape;
21196 if (unlikely(__pyx_t_29 < 0)) __pyx_t_14 = 2;
21197 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21198 if (__pyx_t_30 < 0) {
21199 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[3].shape;
21200 if (unlikely(__pyx_t_30 < 0)) __pyx_t_14 = 3;
21201 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21202 if (unlikely(__pyx_t_14 != -1)) {
21203 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21204 __PYX_ERR(0, 935, __pyx_L1_error)
21206 __pyx_t_31 = __pyx_v_eN;
21207 __pyx_t_32 = __pyx_v_ebN;
21208 __pyx_t_33 = __pyx_v_k;
21211 if (__pyx_t_31 < 0) {
21212 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[0].shape;
21213 if (unlikely(__pyx_t_31 < 0)) __pyx_t_14 = 0;
21214 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21215 if (__pyx_t_32 < 0) {
21216 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[1].shape;
21217 if (unlikely(__pyx_t_32 < 0)) __pyx_t_14 = 1;
21218 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21219 if (__pyx_t_33 < 0) {
21220 __pyx_t_33 += __pyx_pybuffernd_x.diminfo[2].shape;
21221 if (unlikely(__pyx_t_33 < 0)) __pyx_t_14 = 2;
21222 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21223 if (__pyx_t_34 < 0) {
21224 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[3].shape;
21225 if (unlikely(__pyx_t_34 < 0)) __pyx_t_14 = 3;
21226 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21227 if (unlikely(__pyx_t_14 != -1)) {
21228 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21229 __PYX_ERR(0, 935, __pyx_L1_error)
21231 __pyx_t_35 = __pyx_v_eN;
21232 __pyx_t_36 = __pyx_v_ebN;
21233 __pyx_t_37 = __pyx_v_k;
21236 if (__pyx_t_35 < 0) {
21237 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[0].shape;
21238 if (unlikely(__pyx_t_35 < 0)) __pyx_t_14 = 0;
21239 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
21240 if (__pyx_t_36 < 0) {
21241 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[1].shape;
21242 if (unlikely(__pyx_t_36 < 0)) __pyx_t_14 = 1;
21243 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21244 if (__pyx_t_37 < 0) {
21245 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[2].shape;
21246 if (unlikely(__pyx_t_37 < 0)) __pyx_t_14 = 2;
21247 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21248 if (__pyx_t_38 < 0) {
21249 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[3].shape;
21250 if (unlikely(__pyx_t_38 < 0)) __pyx_t_14 = 3;
21251 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21252 if (unlikely(__pyx_t_14 != -1)) {
21253 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21254 __PYX_ERR(0, 935, __pyx_L1_error)
21256 __pyx_t_39 = __pyx_v_eN;
21257 __pyx_t_40 = __pyx_v_ebN;
21258 __pyx_t_41 = __pyx_v_k;
21261 if (__pyx_t_39 < 0) {
21262 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
21263 if (unlikely(__pyx_t_39 < 0)) __pyx_t_14 = 0;
21264 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21265 if (__pyx_t_40 < 0) {
21266 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
21267 if (unlikely(__pyx_t_40 < 0)) __pyx_t_14 = 1;
21268 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21269 if (__pyx_t_41 < 0) {
21270 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
21271 if (unlikely(__pyx_t_41 < 0)) __pyx_t_14 = 2;
21272 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21273 if (__pyx_t_42 < 0) {
21274 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[3].shape;
21275 if (unlikely(__pyx_t_42 < 0)) __pyx_t_14 = 3;
21276 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21277 if (unlikely(__pyx_t_14 != -1)) {
21278 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21279 __PYX_ERR(0, 935, __pyx_L1_error)
21281 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_34, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[3].strides)))));
21295 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21298 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21299 __Pyx_PyThreadState_declare
21300 __Pyx_PyThreadState_assign
21301 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21302 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21303 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21304 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21305 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21309 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21310 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21312 __Pyx_XGIVEREF(__pyx_r);
21313 __Pyx_RefNannyFinishContext();
21326 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
21327 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
21329 __Pyx_RefNannyDeclarations
21330 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
21331 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
21334 __Pyx_RefNannyFinishContext();
21338 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
21341 int __pyx_v_endian_detector;
21342 int __pyx_v_little_endian;
21345 PyArray_Descr *__pyx_v_descr = 0;
21346 int __pyx_v_offset;
21348 __Pyx_RefNannyDeclarations
21351 PyObject *__pyx_t_3 = NULL;
21355 PyObject *__pyx_t_7 = NULL;
21357 if (__pyx_v_info == NULL) {
21358 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
21361 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
21362 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
21363 __Pyx_GIVEREF(__pyx_v_info->obj);
21372 __pyx_v_endian_detector = 1;
21381 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
21390 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
21399 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
21402 __pyx_t_1 = __pyx_t_2;
21403 goto __pyx_L4_bool_binop_done;
21413 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
21414 __pyx_t_1 = __pyx_t_2;
21415 __pyx_L4_bool_binop_done:;
21424 if (unlikely(__pyx_t_1)) {
21433 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
21434 __Pyx_GOTREF(__pyx_t_3);
21435 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21436 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21437 __PYX_ERR(1, 229, __pyx_L1_error)
21455 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
21458 __pyx_t_1 = __pyx_t_2;
21459 goto __pyx_L7_bool_binop_done;
21469 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
21470 __pyx_t_1 = __pyx_t_2;
21471 __pyx_L7_bool_binop_done:;
21480 if (unlikely(__pyx_t_1)) {
21489 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error)
21490 __Pyx_GOTREF(__pyx_t_3);
21491 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21492 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21493 __PYX_ERR(1, 233, __pyx_L1_error)
21511 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
21520 __pyx_v_info->ndim = __pyx_v_ndim;
21529 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
21539 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
21548 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
21557 __pyx_t_4 = __pyx_v_ndim;
21558 __pyx_t_5 = __pyx_t_4;
21559 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21560 __pyx_v_i = __pyx_t_6;
21569 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
21578 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
21599 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
21608 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
21619 __pyx_v_info->suboffsets = NULL;
21628 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
21637 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
21655 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
21656 __Pyx_INCREF(__pyx_t_3);
21657 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
21667 __Pyx_INCREF(((PyObject *)__pyx_v_self));
21668 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21669 __Pyx_GOTREF(__pyx_v_info->obj);
21670 __Pyx_DECREF(__pyx_v_info->obj);
21671 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
21680 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
21690 __pyx_t_4 = __pyx_v_descr->type_num;
21691 __pyx_v_t = __pyx_t_4;
21700 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
21702 goto __pyx_L15_next_or;
21705 __pyx_t_2 = (__pyx_v_little_endian != 0);
21708 __pyx_t_1 = __pyx_t_2;
21709 goto __pyx_L14_bool_binop_done;
21711 __pyx_L15_next_or:;
21720 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
21723 __pyx_t_1 = __pyx_t_2;
21724 goto __pyx_L14_bool_binop_done;
21726 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
21727 __pyx_t_1 = __pyx_t_2;
21728 __pyx_L14_bool_binop_done:;
21737 if (unlikely(__pyx_t_1)) {
21746 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error)
21747 __Pyx_GOTREF(__pyx_t_3);
21748 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21750 __PYX_ERR(1, 263, __pyx_L1_error)
21768 switch (__pyx_v_t) {
21770 __pyx_v_f = ((
char *)
"b");
21781 __pyx_v_f = ((
char *)
"B");
21792 __pyx_v_f = ((
char *)
"h");
21803 __pyx_v_f = ((
char *)
"H");
21814 __pyx_v_f = ((
char *)
"i");
21825 __pyx_v_f = ((
char *)
"I");
21836 __pyx_v_f = ((
char *)
"l");
21847 __pyx_v_f = ((
char *)
"L");
21858 __pyx_v_f = ((
char *)
"q");
21868 case NPY_ULONGLONG:
21869 __pyx_v_f = ((
char *)
"Q");
21880 __pyx_v_f = ((
char *)
"f");
21891 __pyx_v_f = ((
char *)
"d");
21901 case NPY_LONGDOUBLE:
21902 __pyx_v_f = ((
char *)
"g");
21913 __pyx_v_f = ((
char *)
"Zf");
21924 __pyx_v_f = ((
char *)
"Zd");
21934 case NPY_CLONGDOUBLE:
21935 __pyx_v_f = ((
char *)
"Zg");
21946 __pyx_v_f = ((
char *)
"O");
21957 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error)
21958 __Pyx_GOTREF(__pyx_t_3);
21959 __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 282, __pyx_L1_error)
21960 __Pyx_GOTREF(__pyx_t_7);
21961 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21962 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error)
21963 __Pyx_GOTREF(__pyx_t_3);
21964 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21965 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21966 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21967 __PYX_ERR(1, 282, __pyx_L1_error)
21978 __pyx_v_info->format = __pyx_v_f;
22007 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
22016 (__pyx_v_info->format[0]) =
'^';
22025 __pyx_v_offset = 0;
22034 __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_8 == ((
char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error)
22035 __pyx_v_f = __pyx_t_8;
22044 (__pyx_v_f[0]) =
'\x00';
22059 __Pyx_XDECREF(__pyx_t_3);
22060 __Pyx_XDECREF(__pyx_t_7);
22061 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22063 if (__pyx_v_info->obj != NULL) {
22064 __Pyx_GOTREF(__pyx_v_info->obj);
22065 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
22069 if (__pyx_v_info->obj == Py_None) {
22070 __Pyx_GOTREF(__pyx_v_info->obj);
22071 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
22074 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
22075 __Pyx_RefNannyFinishContext();
22088 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
22089 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
22090 __Pyx_RefNannyDeclarations
22091 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
22092 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
22095 __Pyx_RefNannyFinishContext();
22098 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
22099 __Pyx_RefNannyDeclarations
22101 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
22110 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
22120 PyObject_Free(__pyx_v_info->format);
22138 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
22148 PyObject_Free(__pyx_v_info->strides);
22168 __Pyx_RefNannyFinishContext();
22179 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
22180 PyObject *__pyx_r = NULL;
22181 __Pyx_RefNannyDeclarations
22182 PyObject *__pyx_t_1 = NULL;
22183 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
22192 __Pyx_XDECREF(__pyx_r);
22193 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error)
22194 __Pyx_GOTREF(__pyx_t_1);
22195 __pyx_r = __pyx_t_1;
22209 __Pyx_XDECREF(__pyx_t_1);
22210 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
22213 __Pyx_XGIVEREF(__pyx_r);
22214 __Pyx_RefNannyFinishContext();
22226 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
22227 PyObject *__pyx_r = NULL;
22228 __Pyx_RefNannyDeclarations
22229 PyObject *__pyx_t_1 = NULL;
22230 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
22239 __Pyx_XDECREF(__pyx_r);
22240 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error)
22241 __Pyx_GOTREF(__pyx_t_1);
22242 __pyx_r = __pyx_t_1;
22256 __Pyx_XDECREF(__pyx_t_1);
22257 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
22260 __Pyx_XGIVEREF(__pyx_r);
22261 __Pyx_RefNannyFinishContext();
22273 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
22274 PyObject *__pyx_r = NULL;
22275 __Pyx_RefNannyDeclarations
22276 PyObject *__pyx_t_1 = NULL;
22277 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
22286 __Pyx_XDECREF(__pyx_r);
22287 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 782, __pyx_L1_error)
22288 __Pyx_GOTREF(__pyx_t_1);
22289 __pyx_r = __pyx_t_1;
22303 __Pyx_XDECREF(__pyx_t_1);
22304 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
22307 __Pyx_XGIVEREF(__pyx_r);
22308 __Pyx_RefNannyFinishContext();
22320 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
22321 PyObject *__pyx_r = NULL;
22322 __Pyx_RefNannyDeclarations
22323 PyObject *__pyx_t_1 = NULL;
22324 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
22333 __Pyx_XDECREF(__pyx_r);
22334 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 785, __pyx_L1_error)
22335 __Pyx_GOTREF(__pyx_t_1);
22336 __pyx_r = __pyx_t_1;
22350 __Pyx_XDECREF(__pyx_t_1);
22351 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
22354 __Pyx_XGIVEREF(__pyx_r);
22355 __Pyx_RefNannyFinishContext();
22367 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
22368 PyObject *__pyx_r = NULL;
22369 __Pyx_RefNannyDeclarations
22370 PyObject *__pyx_t_1 = NULL;
22371 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
22380 __Pyx_XDECREF(__pyx_r);
22381 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 788, __pyx_L1_error)
22382 __Pyx_GOTREF(__pyx_t_1);
22383 __pyx_r = __pyx_t_1;
22397 __Pyx_XDECREF(__pyx_t_1);
22398 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
22401 __Pyx_XGIVEREF(__pyx_r);
22402 __Pyx_RefNannyFinishContext();
22414 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
22415 PyObject *__pyx_r = NULL;
22416 __Pyx_RefNannyDeclarations
22418 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
22427 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
22437 __Pyx_XDECREF(__pyx_r);
22438 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
22439 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
22459 __Pyx_XDECREF(__pyx_r);
22460 __Pyx_INCREF(__pyx_empty_tuple);
22461 __pyx_r = __pyx_empty_tuple;
22475 __Pyx_XGIVEREF(__pyx_r);
22476 __Pyx_RefNannyFinishContext();
22488 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
22489 PyArray_Descr *__pyx_v_child = 0;
22490 int __pyx_v_endian_detector;
22491 int __pyx_v_little_endian;
22492 PyObject *__pyx_v_fields = 0;
22493 PyObject *__pyx_v_childname = NULL;
22494 PyObject *__pyx_v_new_offset = NULL;
22495 PyObject *__pyx_v_t = NULL;
22497 __Pyx_RefNannyDeclarations
22498 PyObject *__pyx_t_1 = NULL;
22499 Py_ssize_t __pyx_t_2;
22500 PyObject *__pyx_t_3 = NULL;
22501 PyObject *__pyx_t_4 = NULL;
22507 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
22516 __pyx_v_endian_detector = 1;
22525 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
22534 if (unlikely(__pyx_v_descr->names == Py_None)) {
22535 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
22536 __PYX_ERR(1, 805, __pyx_L1_error)
22538 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
22540 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
22541 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22542 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(1, 805, __pyx_L1_error)
22544 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error)
22545 __Pyx_GOTREF(__pyx_t_3);
22547 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
22557 if (unlikely(__pyx_v_descr->fields == Py_None)) {
22558 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
22559 __PYX_ERR(1, 806, __pyx_L1_error)
22561 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
22562 __Pyx_GOTREF(__pyx_t_3);
22563 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 806, __pyx_L1_error)
22564 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
22574 if (likely(__pyx_v_fields != Py_None)) {
22575 PyObject* sequence = __pyx_v_fields;
22576 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22577 if (unlikely(size != 2)) {
22578 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22579 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22580 __PYX_ERR(1, 807, __pyx_L1_error)
22582 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22583 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
22584 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
22585 __Pyx_INCREF(__pyx_t_3);
22586 __Pyx_INCREF(__pyx_t_4);
22588 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error)
22589 __Pyx_GOTREF(__pyx_t_3);
22590 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error)
22591 __Pyx_GOTREF(__pyx_t_4);
22594 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 807, __pyx_L1_error)
22596 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 807, __pyx_L1_error)
22597 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
22599 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
22609 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error)
22610 __Pyx_GOTREF(__pyx_t_4);
22611 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error)
22612 __Pyx_GOTREF(__pyx_t_3);
22613 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22614 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 809, __pyx_L1_error)
22615 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22616 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
22617 if (unlikely(__pyx_t_6)) {
22626 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error)
22627 __Pyx_GOTREF(__pyx_t_3);
22628 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22629 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22630 __PYX_ERR(1, 810, __pyx_L1_error)
22648 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
22650 goto __pyx_L8_next_or;
22653 __pyx_t_7 = (__pyx_v_little_endian != 0);
22656 __pyx_t_6 = __pyx_t_7;
22657 goto __pyx_L7_bool_binop_done;
22668 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
22671 __pyx_t_6 = __pyx_t_7;
22672 goto __pyx_L7_bool_binop_done;
22674 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
22675 __pyx_t_6 = __pyx_t_7;
22676 __pyx_L7_bool_binop_done:;
22685 if (unlikely(__pyx_t_6)) {
22694 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error)
22695 __Pyx_GOTREF(__pyx_t_3);
22696 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22697 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22698 __PYX_ERR(1, 814, __pyx_L1_error)
22717 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
22718 __Pyx_GOTREF(__pyx_t_3);
22719 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error)
22720 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22721 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 824, __pyx_L1_error)
22722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22723 if (!__pyx_t_6)
break;
22732 (__pyx_v_f[0]) = 0x78;
22741 __pyx_v_f = (__pyx_v_f + 1);
22751 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
22762 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
22771 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
22781 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
22782 __Pyx_GOTREF(__pyx_t_4);
22783 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
22793 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
22794 if (unlikely(__pyx_t_6)) {
22803 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
22804 __Pyx_GOTREF(__pyx_t_4);
22805 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22806 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22807 __PYX_ERR(1, 834, __pyx_L1_error)
22825 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
22826 __Pyx_GOTREF(__pyx_t_4);
22827 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
22828 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22829 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
22830 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22832 (__pyx_v_f[0]) = 98;
22843 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
22844 __Pyx_GOTREF(__pyx_t_3);
22845 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
22846 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22847 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
22848 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22850 (__pyx_v_f[0]) = 66;
22861 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
22862 __Pyx_GOTREF(__pyx_t_4);
22863 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
22864 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22865 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
22866 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22868 (__pyx_v_f[0]) = 0x68;
22879 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
22880 __Pyx_GOTREF(__pyx_t_3);
22881 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
22882 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22883 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error)
22884 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22886 (__pyx_v_f[0]) = 72;
22897 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
22898 __Pyx_GOTREF(__pyx_t_4);
22899 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error)
22900 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22901 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
22902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22904 (__pyx_v_f[0]) = 0x69;
22915 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
22916 __Pyx_GOTREF(__pyx_t_3);
22917 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
22918 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22919 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
22920 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22922 (__pyx_v_f[0]) = 73;
22933 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error)
22934 __Pyx_GOTREF(__pyx_t_4);
22935 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 843, __pyx_L1_error)
22936 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22937 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 843, __pyx_L1_error)
22938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22940 (__pyx_v_f[0]) = 0x6C;
22951 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
22952 __Pyx_GOTREF(__pyx_t_3);
22953 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
22954 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22955 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 844, __pyx_L1_error)
22956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22958 (__pyx_v_f[0]) = 76;
22969 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 845, __pyx_L1_error)
22970 __Pyx_GOTREF(__pyx_t_4);
22971 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 845, __pyx_L1_error)
22972 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22973 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 845, __pyx_L1_error)
22974 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22976 (__pyx_v_f[0]) = 0x71;
22987 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 846, __pyx_L1_error)
22988 __Pyx_GOTREF(__pyx_t_3);
22989 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 846, __pyx_L1_error)
22990 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22991 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 846, __pyx_L1_error)
22992 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22994 (__pyx_v_f[0]) = 81;
23005 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error)
23006 __Pyx_GOTREF(__pyx_t_4);
23007 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 847, __pyx_L1_error)
23008 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23009 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 847, __pyx_L1_error)
23010 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23012 (__pyx_v_f[0]) = 0x66;
23023 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 848, __pyx_L1_error)
23024 __Pyx_GOTREF(__pyx_t_3);
23025 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 848, __pyx_L1_error)
23026 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23027 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 848, __pyx_L1_error)
23028 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23030 (__pyx_v_f[0]) = 0x64;
23041 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 849, __pyx_L1_error)
23042 __Pyx_GOTREF(__pyx_t_4);
23043 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 849, __pyx_L1_error)
23044 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23045 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 849, __pyx_L1_error)
23046 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23048 (__pyx_v_f[0]) = 0x67;
23059 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error)
23060 __Pyx_GOTREF(__pyx_t_3);
23061 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 850, __pyx_L1_error)
23062 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23063 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 850, __pyx_L1_error)
23064 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23066 (__pyx_v_f[0]) = 90;
23067 (__pyx_v_f[1]) = 0x66;
23068 __pyx_v_f = (__pyx_v_f + 1);
23079 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error)
23080 __Pyx_GOTREF(__pyx_t_4);
23081 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
23082 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23083 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
23084 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23086 (__pyx_v_f[0]) = 90;
23087 (__pyx_v_f[1]) = 0x64;
23088 __pyx_v_f = (__pyx_v_f + 1);
23099 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
23100 __Pyx_GOTREF(__pyx_t_3);
23101 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error)
23102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23103 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 852, __pyx_L1_error)
23104 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23106 (__pyx_v_f[0]) = 90;
23107 (__pyx_v_f[1]) = 0x67;
23108 __pyx_v_f = (__pyx_v_f + 1);
23119 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
23120 __Pyx_GOTREF(__pyx_t_4);
23121 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
23122 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23123 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 853, __pyx_L1_error)
23124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23125 if (likely(__pyx_t_6)) {
23126 (__pyx_v_f[0]) = 79;
23138 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
23139 __Pyx_GOTREF(__pyx_t_3);
23140 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
23141 __Pyx_GOTREF(__pyx_t_4);
23142 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23143 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23144 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23145 __PYX_ERR(1, 855, __pyx_L1_error)
23156 __pyx_v_f = (__pyx_v_f + 1);
23176 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(1, 860, __pyx_L1_error)
23177 __pyx_v_f = __pyx_t_9;
23189 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23198 __pyx_r = __pyx_v_f;
23211 __Pyx_XDECREF(__pyx_t_1);
23212 __Pyx_XDECREF(__pyx_t_3);
23213 __Pyx_XDECREF(__pyx_t_4);
23214 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
23217 __Pyx_XDECREF((PyObject *)__pyx_v_child);
23218 __Pyx_XDECREF(__pyx_v_fields);
23219 __Pyx_XDECREF(__pyx_v_childname);
23220 __Pyx_XDECREF(__pyx_v_new_offset);
23221 __Pyx_XDECREF(__pyx_v_t);
23222 __Pyx_RefNannyFinishContext();
23234 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
23235 PyObject *__pyx_v_baseptr;
23236 __Pyx_RefNannyDeclarations
23239 __Pyx_RefNannySetupContext(
"set_array_base", 0);
23248 __pyx_t_1 = (__pyx_v_base == Py_None);
23249 __pyx_t_2 = (__pyx_t_1 != 0);
23259 __pyx_v_baseptr = NULL;
23279 Py_INCREF(__pyx_v_base);
23288 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
23299 Py_XDECREF(__pyx_v_arr->base);
23308 __pyx_v_arr->base = __pyx_v_baseptr;
23319 __Pyx_RefNannyFinishContext();
23330 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
23331 PyObject *__pyx_r = NULL;
23332 __Pyx_RefNannyDeclarations
23334 __Pyx_RefNannySetupContext(
"get_array_base", 0);
23343 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
23353 __Pyx_XDECREF(__pyx_r);
23354 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23374 __Pyx_XDECREF(__pyx_r);
23375 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
23376 __pyx_r = ((PyObject *)__pyx_v_arr->base);
23390 __Pyx_XGIVEREF(__pyx_r);
23391 __Pyx_RefNannyFinishContext();
23403 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
23405 __Pyx_RefNannyDeclarations
23406 PyObject *__pyx_t_1 = NULL;
23407 PyObject *__pyx_t_2 = NULL;
23408 PyObject *__pyx_t_3 = NULL;
23410 PyObject *__pyx_t_5 = NULL;
23411 PyObject *__pyx_t_6 = NULL;
23412 PyObject *__pyx_t_7 = NULL;
23413 PyObject *__pyx_t_8 = NULL;
23414 __Pyx_RefNannySetupContext(
"import_array", 0);
23424 __Pyx_PyThreadState_declare
23425 __Pyx_PyThreadState_assign
23426 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
23427 __Pyx_XGOTREF(__pyx_t_1);
23428 __Pyx_XGOTREF(__pyx_t_2);
23429 __Pyx_XGOTREF(__pyx_t_3);
23439 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 998, __pyx_L3_error)
23449 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23450 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23451 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23452 goto __pyx_L8_try_end;
23462 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
23464 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
23465 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 999, __pyx_L5_except_error)
23466 __Pyx_GOTREF(__pyx_t_5);
23467 __Pyx_GOTREF(__pyx_t_6);
23468 __Pyx_GOTREF(__pyx_t_7);
23477 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __pyx_L5_except_error)
23478 __Pyx_GOTREF(__pyx_t_8);
23479 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23480 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23481 __PYX_ERR(1, 1000, __pyx_L5_except_error)
23483 goto __pyx_L5_except_error;
23484 __pyx_L5_except_error:;
23493 __Pyx_XGIVEREF(__pyx_t_1);
23494 __Pyx_XGIVEREF(__pyx_t_2);
23495 __Pyx_XGIVEREF(__pyx_t_3);
23496 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23497 goto __pyx_L1_error;
23513 __Pyx_XDECREF(__pyx_t_5);
23514 __Pyx_XDECREF(__pyx_t_6);
23515 __Pyx_XDECREF(__pyx_t_7);
23516 __Pyx_XDECREF(__pyx_t_8);
23517 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
23520 __Pyx_RefNannyFinishContext();
23532 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
23534 __Pyx_RefNannyDeclarations
23535 PyObject *__pyx_t_1 = NULL;
23536 PyObject *__pyx_t_2 = NULL;
23537 PyObject *__pyx_t_3 = NULL;
23539 PyObject *__pyx_t_5 = NULL;
23540 PyObject *__pyx_t_6 = NULL;
23541 PyObject *__pyx_t_7 = NULL;
23542 PyObject *__pyx_t_8 = NULL;
23543 __Pyx_RefNannySetupContext(
"import_umath", 0);
23553 __Pyx_PyThreadState_declare
23554 __Pyx_PyThreadState_assign
23555 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
23556 __Pyx_XGOTREF(__pyx_t_1);
23557 __Pyx_XGOTREF(__pyx_t_2);
23558 __Pyx_XGOTREF(__pyx_t_3);
23568 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1004, __pyx_L3_error)
23578 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23579 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23580 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23581 goto __pyx_L8_try_end;
23591 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
23593 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
23594 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1005, __pyx_L5_except_error)
23595 __Pyx_GOTREF(__pyx_t_5);
23596 __Pyx_GOTREF(__pyx_t_6);
23597 __Pyx_GOTREF(__pyx_t_7);
23606 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __pyx_L5_except_error)
23607 __Pyx_GOTREF(__pyx_t_8);
23608 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23609 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23610 __PYX_ERR(1, 1006, __pyx_L5_except_error)
23612 goto __pyx_L5_except_error;
23613 __pyx_L5_except_error:;
23622 __Pyx_XGIVEREF(__pyx_t_1);
23623 __Pyx_XGIVEREF(__pyx_t_2);
23624 __Pyx_XGIVEREF(__pyx_t_3);
23625 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23626 goto __pyx_L1_error;
23642 __Pyx_XDECREF(__pyx_t_5);
23643 __Pyx_XDECREF(__pyx_t_6);
23644 __Pyx_XDECREF(__pyx_t_7);
23645 __Pyx_XDECREF(__pyx_t_8);
23646 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
23649 __Pyx_RefNannyFinishContext();
23661 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
23663 __Pyx_RefNannyDeclarations
23664 PyObject *__pyx_t_1 = NULL;
23665 PyObject *__pyx_t_2 = NULL;
23666 PyObject *__pyx_t_3 = NULL;
23668 PyObject *__pyx_t_5 = NULL;
23669 PyObject *__pyx_t_6 = NULL;
23670 PyObject *__pyx_t_7 = NULL;
23671 PyObject *__pyx_t_8 = NULL;
23672 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
23682 __Pyx_PyThreadState_declare
23683 __Pyx_PyThreadState_assign
23684 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
23685 __Pyx_XGOTREF(__pyx_t_1);
23686 __Pyx_XGOTREF(__pyx_t_2);
23687 __Pyx_XGOTREF(__pyx_t_3);
23697 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1010, __pyx_L3_error)
23707 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23708 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23709 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23710 goto __pyx_L8_try_end;
23719 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
23721 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
23722 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1011, __pyx_L5_except_error)
23723 __Pyx_GOTREF(__pyx_t_5);
23724 __Pyx_GOTREF(__pyx_t_6);
23725 __Pyx_GOTREF(__pyx_t_7);
23732 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __pyx_L5_except_error)
23733 __Pyx_GOTREF(__pyx_t_8);
23734 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23735 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23736 __PYX_ERR(1, 1012, __pyx_L5_except_error)
23738 goto __pyx_L5_except_error;
23739 __pyx_L5_except_error:;
23748 __Pyx_XGIVEREF(__pyx_t_1);
23749 __Pyx_XGIVEREF(__pyx_t_2);
23750 __Pyx_XGIVEREF(__pyx_t_3);
23751 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23752 goto __pyx_L1_error;
23768 __Pyx_XDECREF(__pyx_t_5);
23769 __Pyx_XDECREF(__pyx_t_6);
23770 __Pyx_XDECREF(__pyx_t_7);
23771 __Pyx_XDECREF(__pyx_t_8);
23772 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
23775 __Pyx_RefNannyFinishContext();
23779 static PyMethodDef __pyx_methods[] = {
23783 #if PY_MAJOR_VERSION >= 3
23784 #if CYTHON_PEP489_MULTI_PHASE_INIT
23785 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
23786 static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject* module);
23787 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23788 {Py_mod_create, (
void*)__pyx_pymod_create},
23789 {Py_mod_exec, (
void*)__pyx_pymod_exec_subsurfaceTransportFunctions},
23794 static struct PyModuleDef __pyx_moduledef = {
23795 PyModuleDef_HEAD_INIT,
23796 "subsurfaceTransportFunctions",
23798 #if CYTHON_PEP489_MULTI_PHASE_INIT
23804 #if CYTHON_PEP489_MULTI_PHASE_INIT
23805 __pyx_moduledef_slots,
23815 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23816 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
23817 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
23818 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
23819 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
23820 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23821 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23822 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
23823 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23824 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
23825 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
23826 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
23827 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23828 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
23829 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
23830 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
23831 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
23832 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23833 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23834 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
23835 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
23836 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
23837 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
23838 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
23839 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
23840 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
23841 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
23842 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
23843 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23844 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
23845 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
23846 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
23847 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
23848 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
23849 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
23850 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
23851 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
23852 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
23853 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
23854 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
23855 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
23856 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
23857 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
23858 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
23859 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
23860 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
23861 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
23862 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
23863 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
23864 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
23865 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
23866 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
23867 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
23868 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
23869 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
23870 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
23871 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
23872 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
23873 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
23874 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
23875 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
23876 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
23877 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
23878 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
23879 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
23880 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
23881 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
23882 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
23883 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
23884 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
23885 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
23886 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
23887 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
23888 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
23889 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
23890 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
23891 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
23892 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
23893 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
23894 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23895 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
23896 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
23897 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
23898 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
23899 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
23900 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
23901 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
23902 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
23903 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
23904 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23905 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
23906 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
23907 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
23908 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
23909 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
23910 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
23911 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
23912 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
23913 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
23914 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
23915 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
23916 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
23917 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
23918 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
23919 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
23920 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
23921 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
23922 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
23923 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
23924 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23925 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23926 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
23927 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
23928 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23929 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23930 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23931 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
23932 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
23933 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
23934 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
23935 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
23936 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
23937 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
23938 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
23939 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
23940 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
23941 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
23942 {&__pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_k_proteus_subsurfaceTransportFunct,
sizeof(__pyx_k_proteus_subsurfaceTransportFunct), 0, 0, 1, 0},
23943 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
23944 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
23945 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
23946 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
23947 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
23948 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
23949 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
23950 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
23951 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
23952 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
23953 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
23954 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
23955 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
23956 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
23957 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
23958 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
23959 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
23960 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
23961 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
23962 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
23963 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
23964 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23965 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
23966 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
23967 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
23968 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
23969 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
23970 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
23971 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
23972 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
23973 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
23974 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
23975 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
23976 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
23977 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
23978 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
23979 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
23980 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23981 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
23982 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
23983 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
23984 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
23985 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
23986 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23987 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
23988 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
23989 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
23990 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
23991 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
23992 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
23993 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
23994 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
23995 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
23996 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
23997 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
23998 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23999 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
24000 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
24001 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
24002 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
24003 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
24004 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
24005 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
24006 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
24007 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
24008 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
24009 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
24010 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
24011 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
24012 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
24013 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
24014 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
24015 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
24016 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
24017 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
24018 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
24019 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
24020 {0, 0, 0, 0, 0, 0, 0}
24022 static int __Pyx_InitCachedBuiltins(
void) {
24023 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 24, __pyx_L1_error)
24024 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error)
24025 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error)
24026 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error)
24032 static int __Pyx_InitCachedConstants(
void) {
24033 __Pyx_RefNannyDeclarations
24034 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
24043 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 66, __pyx_L1_error)
24044 __Pyx_GOTREF(__pyx_slice_);
24045 __Pyx_GIVEREF(__pyx_slice_);
24054 __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 192, __pyx_L1_error)
24055 __Pyx_GOTREF(__pyx_slice__2);
24056 __Pyx_GIVEREF(__pyx_slice__2);
24065 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 794, __pyx_L1_error)
24066 __Pyx_GOTREF(__pyx_slice__3);
24067 __Pyx_GIVEREF(__pyx_slice__3);
24076 __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 808, __pyx_L1_error)
24077 __Pyx_GOTREF(__pyx_slice__4);
24078 __Pyx_GIVEREF(__pyx_slice__4);
24087 __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 835, __pyx_L1_error)
24088 __Pyx_GOTREF(__pyx_slice__5);
24089 __Pyx_GIVEREF(__pyx_slice__5);
24098 __pyx_slice__6 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 851, __pyx_L1_error)
24099 __Pyx_GOTREF(__pyx_slice__6);
24100 __Pyx_GIVEREF(__pyx_slice__6);
24109 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 876, __pyx_L1_error)
24110 __Pyx_GOTREF(__pyx_slice__7);
24111 __Pyx_GIVEREF(__pyx_slice__7);
24120 __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 902, __pyx_L1_error)
24121 __Pyx_GOTREF(__pyx_slice__8);
24122 __Pyx_GIVEREF(__pyx_slice__8);
24131 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 229, __pyx_L1_error)
24132 __Pyx_GOTREF(__pyx_tuple__9);
24133 __Pyx_GIVEREF(__pyx_tuple__9);
24142 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 233, __pyx_L1_error)
24143 __Pyx_GOTREF(__pyx_tuple__10);
24144 __Pyx_GIVEREF(__pyx_tuple__10);
24153 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 263, __pyx_L1_error)
24154 __Pyx_GOTREF(__pyx_tuple__11);
24155 __Pyx_GIVEREF(__pyx_tuple__11);
24164 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 810, __pyx_L1_error)
24165 __Pyx_GOTREF(__pyx_tuple__12);
24166 __Pyx_GIVEREF(__pyx_tuple__12);
24175 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 814, __pyx_L1_error)
24176 __Pyx_GOTREF(__pyx_tuple__13);
24177 __Pyx_GIVEREF(__pyx_tuple__13);
24186 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 834, __pyx_L1_error)
24187 __Pyx_GOTREF(__pyx_tuple__14);
24188 __Pyx_GIVEREF(__pyx_tuple__14);
24197 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1000, __pyx_L1_error)
24198 __Pyx_GOTREF(__pyx_tuple__15);
24199 __Pyx_GIVEREF(__pyx_tuple__15);
24208 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 1006, __pyx_L1_error)
24209 __Pyx_GOTREF(__pyx_tuple__16);
24210 __Pyx_GIVEREF(__pyx_tuple__16);
24217 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 1012, __pyx_L1_error)
24218 __Pyx_GOTREF(__pyx_tuple__17);
24219 __Pyx_GIVEREF(__pyx_tuple__17);
24228 __pyx_tuple__18 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 18, __pyx_L1_error)
24229 __Pyx_GOTREF(__pyx_tuple__18);
24230 __Pyx_GIVEREF(__pyx_tuple__18);
24231 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 18, __pyx_L1_error)
24240 __pyx_tuple__20 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 29, __pyx_L1_error)
24241 __Pyx_GOTREF(__pyx_tuple__20);
24242 __Pyx_GIVEREF(__pyx_tuple__20);
24243 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 29, __pyx_L1_error)
24252 __pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 43, __pyx_L1_error)
24253 __Pyx_GOTREF(__pyx_tuple__22);
24254 __Pyx_GIVEREF(__pyx_tuple__22);
24255 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 43, __pyx_L1_error)
24264 __pyx_tuple__24 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 56, __pyx_L1_error)
24265 __Pyx_GOTREF(__pyx_tuple__24);
24266 __Pyx_GIVEREF(__pyx_tuple__24);
24267 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 56, __pyx_L1_error)
24276 __pyx_tuple__26 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 69, __pyx_L1_error)
24277 __Pyx_GOTREF(__pyx_tuple__26);
24278 __Pyx_GIVEREF(__pyx_tuple__26);
24279 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 69, __pyx_L1_error)
24288 __pyx_tuple__28 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 91, __pyx_L1_error)
24289 __Pyx_GOTREF(__pyx_tuple__28);
24290 __Pyx_GIVEREF(__pyx_tuple__28);
24291 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 91, __pyx_L1_error)
24300 __pyx_tuple__30 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 118, __pyx_L1_error)
24301 __Pyx_GOTREF(__pyx_tuple__30);
24302 __Pyx_GIVEREF(__pyx_tuple__30);
24303 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 118, __pyx_L1_error)
24312 __pyx_tuple__32 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 139, __pyx_L1_error)
24313 __Pyx_GOTREF(__pyx_tuple__32);
24314 __Pyx_GIVEREF(__pyx_tuple__32);
24315 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 139, __pyx_L1_error)
24324 __pyx_tuple__34 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 165, __pyx_L1_error)
24325 __Pyx_GOTREF(__pyx_tuple__34);
24326 __Pyx_GIVEREF(__pyx_tuple__34);
24327 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 165, __pyx_L1_error)
24336 __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 180, __pyx_L1_error)
24337 __Pyx_GOTREF(__pyx_tuple__36);
24338 __Pyx_GIVEREF(__pyx_tuple__36);
24339 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 180, __pyx_L1_error)
24348 __pyx_tuple__38 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 195, __pyx_L1_error)
24349 __Pyx_GOTREF(__pyx_tuple__38);
24350 __Pyx_GIVEREF(__pyx_tuple__38);
24351 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 195, __pyx_L1_error)
24360 __pyx_tuple__40 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 219, __pyx_L1_error)
24361 __Pyx_GOTREF(__pyx_tuple__40);
24362 __Pyx_GIVEREF(__pyx_tuple__40);
24363 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 219, __pyx_L1_error)
24372 __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 248, __pyx_L1_error)
24373 __Pyx_GOTREF(__pyx_tuple__42);
24374 __Pyx_GIVEREF(__pyx_tuple__42);
24375 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 248, __pyx_L1_error)
24384 __pyx_tuple__44 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 271, __pyx_L1_error)
24385 __Pyx_GOTREF(__pyx_tuple__44);
24386 __Pyx_GIVEREF(__pyx_tuple__44);
24387 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 271, __pyx_L1_error)
24396 __pyx_tuple__46 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 301, __pyx_L1_error)
24397 __Pyx_GOTREF(__pyx_tuple__46);
24398 __Pyx_GIVEREF(__pyx_tuple__46);
24399 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 301, __pyx_L1_error)
24408 __pyx_tuple__48 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 359, __pyx_L1_error)
24409 __Pyx_GOTREF(__pyx_tuple__48);
24410 __Pyx_GIVEREF(__pyx_tuple__48);
24411 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 359, __pyx_L1_error)
24420 __pyx_tuple__50 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 486, __pyx_L1_error)
24421 __Pyx_GOTREF(__pyx_tuple__50);
24422 __Pyx_GIVEREF(__pyx_tuple__50);
24423 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 486, __pyx_L1_error)
24432 __pyx_tuple__52 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 574, __pyx_L1_error)
24433 __Pyx_GOTREF(__pyx_tuple__52);
24434 __Pyx_GIVEREF(__pyx_tuple__52);
24435 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 574, __pyx_L1_error)
24444 __pyx_tuple__54 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 673, __pyx_L1_error)
24445 __Pyx_GOTREF(__pyx_tuple__54);
24446 __Pyx_GIVEREF(__pyx_tuple__54);
24447 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 673, __pyx_L1_error)
24456 __pyx_tuple__56 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 692, __pyx_L1_error)
24457 __Pyx_GOTREF(__pyx_tuple__56);
24458 __Pyx_GIVEREF(__pyx_tuple__56);
24459 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 692, __pyx_L1_error)
24468 __pyx_tuple__58 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 717, __pyx_L1_error)
24469 __Pyx_GOTREF(__pyx_tuple__58);
24470 __Pyx_GIVEREF(__pyx_tuple__58);
24471 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 717, __pyx_L1_error)
24480 __pyx_tuple__60 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 732, __pyx_L1_error)
24481 __Pyx_GOTREF(__pyx_tuple__60);
24482 __Pyx_GIVEREF(__pyx_tuple__60);
24483 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 732, __pyx_L1_error)
24492 __pyx_tuple__62 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 753, __pyx_L1_error)
24493 __Pyx_GOTREF(__pyx_tuple__62);
24494 __Pyx_GIVEREF(__pyx_tuple__62);
24495 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 753, __pyx_L1_error)
24504 __pyx_tuple__64 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 776, __pyx_L1_error)
24505 __Pyx_GOTREF(__pyx_tuple__64);
24506 __Pyx_GIVEREF(__pyx_tuple__64);
24507 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 776, __pyx_L1_error)
24516 __pyx_tuple__66 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 816, __pyx_L1_error)
24517 __Pyx_GOTREF(__pyx_tuple__66);
24518 __Pyx_GIVEREF(__pyx_tuple__66);
24519 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 816, __pyx_L1_error)
24528 __pyx_tuple__68 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 859, __pyx_L1_error)
24529 __Pyx_GOTREF(__pyx_tuple__68);
24530 __Pyx_GIVEREF(__pyx_tuple__68);
24531 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 859, __pyx_L1_error)
24540 __pyx_tuple__70 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 884, __pyx_L1_error)
24541 __Pyx_GOTREF(__pyx_tuple__70);
24542 __Pyx_GIVEREF(__pyx_tuple__70);
24543 __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 884, __pyx_L1_error)
24552 __pyx_tuple__72 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 911, __pyx_L1_error)
24553 __Pyx_GOTREF(__pyx_tuple__72);
24554 __Pyx_GIVEREF(__pyx_tuple__72);
24555 __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 911, __pyx_L1_error)
24564 __pyx_tuple__74 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 924, __pyx_L1_error)
24565 __Pyx_GOTREF(__pyx_tuple__74);
24566 __Pyx_GIVEREF(__pyx_tuple__74);
24567 __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 924, __pyx_L1_error)
24568 __Pyx_RefNannyFinishContext();
24571 __Pyx_RefNannyFinishContext();
24575 static int __Pyx_InitGlobals(
void) {
24576 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24577 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
24578 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
24579 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
24580 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) __PYX_ERR(0, 1, __pyx_L1_error)
24586 static int __Pyx_modinit_global_init_code(
void);
24587 static int __Pyx_modinit_variable_export_code(
void);
24588 static int __Pyx_modinit_function_export_code(
void);
24589 static int __Pyx_modinit_type_init_code(
void);
24590 static int __Pyx_modinit_type_import_code(
void);
24591 static int __Pyx_modinit_variable_import_code(
void);
24592 static int __Pyx_modinit_function_import_code(
void);
24594 static int __Pyx_modinit_global_init_code(
void) {
24595 __Pyx_RefNannyDeclarations
24596 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
24598 __Pyx_RefNannyFinishContext();
24602 static int __Pyx_modinit_variable_export_code(
void) {
24603 __Pyx_RefNannyDeclarations
24604 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
24606 __Pyx_RefNannyFinishContext();
24610 static int __Pyx_modinit_function_export_code(
void) {
24611 __Pyx_RefNannyDeclarations
24612 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
24614 __Pyx_RefNannyFinishContext();
24618 static int __Pyx_modinit_type_init_code(
void) {
24619 __Pyx_RefNannyDeclarations
24620 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
24622 __Pyx_RefNannyFinishContext();
24626 static int __Pyx_modinit_type_import_code(
void) {
24627 __Pyx_RefNannyDeclarations
24628 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
24630 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
24631 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24632 sizeof(PyTypeObject),
24634 sizeof(PyHeapTypeObject),
24636 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
24637 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 164, __pyx_L1_error)
24638 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 186, __pyx_L1_error)
24639 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 190, __pyx_L1_error)
24640 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 199, __pyx_L1_error)
24641 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 872, __pyx_L1_error)
24642 __Pyx_RefNannyFinishContext();
24645 __Pyx_RefNannyFinishContext();
24649 static int __Pyx_modinit_variable_import_code(
void) {
24650 __Pyx_RefNannyDeclarations
24651 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
24653 __Pyx_RefNannyFinishContext();
24657 static int __Pyx_modinit_function_import_code(
void) {
24658 __Pyx_RefNannyDeclarations
24659 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
24661 __Pyx_RefNannyFinishContext();
24666 #if PY_MAJOR_VERSION < 3
24667 #ifdef CYTHON_NO_PYINIT_EXPORT
24668 #define __Pyx_PyMODINIT_FUNC void
24670 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24673 #ifdef CYTHON_NO_PYINIT_EXPORT
24674 #define __Pyx_PyMODINIT_FUNC PyObject *
24676 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24679 #ifndef CYTHON_SMALL_CODE
24680 #if defined(__clang__)
24681 #define CYTHON_SMALL_CODE
24682 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
24683 #define CYTHON_SMALL_CODE __attribute__((cold))
24685 #define CYTHON_SMALL_CODE
24690 #if PY_MAJOR_VERSION < 3
24691 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
24692 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void)
24694 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
24695 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void)
24696 #if CYTHON_PEP489_MULTI_PHASE_INIT
24698 return PyModuleDef_Init(&__pyx_moduledef);
24700 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
24701 PyObject *value = PyObject_GetAttrString(spec, from_name);
24703 if (likely(value)) {
24704 result = PyDict_SetItemString(moddict, to_name, value);
24706 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24713 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24714 PyObject *module = NULL, *moddict, *modname;
24716 return __Pyx_NewRef(__pyx_m);
24717 modname = PyObject_GetAttrString(spec,
"name");
24718 if (unlikely(!modname))
goto bad;
24719 module = PyModule_NewObject(modname);
24720 Py_DECREF(modname);
24721 if (unlikely(!module))
goto bad;
24722 moddict = PyModule_GetDict(module);
24723 if (unlikely(!moddict))
goto bad;
24724 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
24725 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
24726 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
24727 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
24730 Py_XDECREF(module);
24735 static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject *__pyx_pyinit_module)
24739 PyObject *__pyx_t_1 = NULL;
24740 __Pyx_RefNannyDeclarations
24741 #if CYTHON_PEP489_MULTI_PHASE_INIT
24742 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
24743 #elif PY_MAJOR_VERSION >= 3
24744 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24746 #if CYTHON_REFNANNY
24747 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24748 if (!__Pyx_RefNanny) {
24750 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24751 if (!__Pyx_RefNanny)
24752 Py_FatalError(
"failed to import 'refnanny' module");
24755 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
24756 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24757 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24758 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24759 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24760 #ifdef __Pyx_CyFunction_USED
24761 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24763 #ifdef __Pyx_FusedFunction_USED
24764 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24766 #ifdef __Pyx_Coroutine_USED
24767 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24769 #ifdef __Pyx_Generator_USED
24770 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24772 #ifdef __Pyx_AsyncGen_USED
24773 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24775 #ifdef __Pyx_StopAsyncIteration_USED
24776 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24780 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24782 PyEval_InitThreads();
24786 #if CYTHON_PEP489_MULTI_PHASE_INIT
24787 __pyx_m = __pyx_pyinit_module;
24788 Py_INCREF(__pyx_m);
24790 #if PY_MAJOR_VERSION < 3
24791 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24793 __pyx_m = PyModule_Create(&__pyx_moduledef);
24795 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24797 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24798 Py_INCREF(__pyx_d);
24799 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24800 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24801 #if CYTHON_COMPILING_IN_PYPY
24802 Py_INCREF(__pyx_b);
24804 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24806 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24807 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24808 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24810 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
24811 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24813 #if PY_MAJOR_VERSION >= 3
24815 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24816 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
24817 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24822 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24824 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24826 (void)__Pyx_modinit_global_init_code();
24827 (void)__Pyx_modinit_variable_export_code();
24828 (void)__Pyx_modinit_function_export_code();
24829 (void)__Pyx_modinit_type_init_code();
24830 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
24831 (void)__Pyx_modinit_variable_import_code();
24832 (void)__Pyx_modinit_function_import_code();
24834 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24835 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24843 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24844 __Pyx_GOTREF(__pyx_t_1);
24845 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24855 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
24856 __Pyx_GOTREF(__pyx_t_1);
24857 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
24858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24867 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
24868 __Pyx_GOTREF(__pyx_t_1);
24869 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
24870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24879 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
24880 __Pyx_GOTREF(__pyx_t_1);
24881 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
24882 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24891 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
24892 __Pyx_GOTREF(__pyx_t_1);
24893 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
24894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24903 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
24904 __Pyx_GOTREF(__pyx_t_1);
24905 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
24906 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24915 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
24916 __Pyx_GOTREF(__pyx_t_1);
24917 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
24918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24927 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
24928 __Pyx_GOTREF(__pyx_t_1);
24929 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
24930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24939 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
24940 __Pyx_GOTREF(__pyx_t_1);
24941 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
24942 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24951 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24952 __Pyx_GOTREF(__pyx_t_1);
24953 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24954 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24963 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
24964 __Pyx_GOTREF(__pyx_t_1);
24965 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
24966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24975 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
24976 __Pyx_GOTREF(__pyx_t_1);
24977 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
24978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24987 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
24988 __Pyx_GOTREF(__pyx_t_1);
24989 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
24990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24999 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
25000 __Pyx_GOTREF(__pyx_t_1);
25001 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
25002 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25011 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
25012 __Pyx_GOTREF(__pyx_t_1);
25013 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
25014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25023 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
25024 __Pyx_GOTREF(__pyx_t_1);
25025 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
25026 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25035 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
25036 __Pyx_GOTREF(__pyx_t_1);
25037 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
25038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25047 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
25048 __Pyx_GOTREF(__pyx_t_1);
25049 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
25050 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25059 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
25060 __Pyx_GOTREF(__pyx_t_1);
25061 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
25062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25071 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
25072 __Pyx_GOTREF(__pyx_t_1);
25073 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
25074 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25083 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
25084 __Pyx_GOTREF(__pyx_t_1);
25085 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
25086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25095 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
25096 __Pyx_GOTREF(__pyx_t_1);
25097 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
25098 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25107 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
25108 __Pyx_GOTREF(__pyx_t_1);
25109 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
25110 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25119 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
25120 __Pyx_GOTREF(__pyx_t_1);
25121 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
25122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25131 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
25132 __Pyx_GOTREF(__pyx_t_1);
25133 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
25134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25143 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
25144 __Pyx_GOTREF(__pyx_t_1);
25145 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
25146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25155 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
25156 __Pyx_GOTREF(__pyx_t_1);
25157 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
25158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25167 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
25168 __Pyx_GOTREF(__pyx_t_1);
25169 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
25170 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25179 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
25180 __Pyx_GOTREF(__pyx_t_1);
25181 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
25182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25191 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
25192 __Pyx_GOTREF(__pyx_t_1);
25193 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
25194 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25201 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25202 __Pyx_GOTREF(__pyx_t_1);
25203 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25204 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25218 __Pyx_XDECREF(__pyx_t_1);
25221 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", 0, __pyx_lineno, __pyx_filename);
25223 Py_DECREF(__pyx_m); __pyx_m = 0;
25224 }
else if (!PyErr_Occurred()) {
25225 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
25228 __Pyx_RefNannyFinishContext();
25229 #if CYTHON_PEP489_MULTI_PHASE_INIT
25230 return (__pyx_m != NULL) ? 0 : -1;
25231 #elif PY_MAJOR_VERSION >= 3
25240 #if CYTHON_REFNANNY
25241 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
25242 PyObject *m = NULL, *p = NULL;
25244 m = PyImport_ImportModule((
char *)modname);
25246 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
25248 r = PyLong_AsVoidPtr(p);
25252 return (__Pyx_RefNannyAPIStruct *)
r;
25257 #if CYTHON_USE_TYPE_SLOTS
25258 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
25259 PyTypeObject* tp = Py_TYPE(obj);
25260 if (likely(tp->tp_getattro))
25261 return tp->tp_getattro(obj, attr_name);
25262 #if PY_MAJOR_VERSION < 3
25263 if (likely(tp->tp_getattr))
25264 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
25266 return PyObject_GetAttr(obj, attr_name);
25271 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
25272 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
25273 if (unlikely(!result)) {
25274 PyErr_Format(PyExc_NameError,
25275 #
if PY_MAJOR_VERSION >= 3
25276 "name '%U' is not defined", name);
25278 "name '%.200s' is not defined", PyString_AS_STRING(name));
25285 static void __Pyx_RaiseArgtupleInvalid(
25286 const char* func_name,
25288 Py_ssize_t num_min,
25289 Py_ssize_t num_max,
25290 Py_ssize_t num_found)
25292 Py_ssize_t num_expected;
25293 const char *more_or_less;
25294 if (num_found < num_min) {
25295 num_expected = num_min;
25296 more_or_less =
"at least";
25298 num_expected = num_max;
25299 more_or_less =
"at most";
25302 more_or_less =
"exactly";
25304 PyErr_Format(PyExc_TypeError,
25305 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25306 func_name, more_or_less, num_expected,
25307 (num_expected == 1) ?
"" :
"s", num_found);
25311 static void __Pyx_RaiseDoubleKeywordsError(
25312 const char* func_name,
25315 PyErr_Format(PyExc_TypeError,
25316 #
if PY_MAJOR_VERSION >= 3
25317 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
25319 "%s() got multiple values for keyword argument '%s'", func_name,
25320 PyString_AsString(kw_name));
25325 static int __Pyx_ParseOptionalKeywords(
25327 PyObject **argnames[],
25329 PyObject *values[],
25330 Py_ssize_t num_pos_args,
25331 const char* function_name)
25333 PyObject *key = 0, *value = 0;
25334 Py_ssize_t
pos = 0;
25336 PyObject*** first_kw_arg = argnames + num_pos_args;
25337 while (PyDict_Next(kwds, &
pos, &key, &value)) {
25338 name = first_kw_arg;
25339 while (*name && (**name != key)) name++;
25341 values[name-argnames] = value;
25344 name = first_kw_arg;
25345 #if PY_MAJOR_VERSION < 3
25346 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
25348 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
25349 && _PyString_Eq(**name, key)) {
25350 values[name-argnames] = value;
25355 if (*name)
continue;
25357 PyObject*** argname = argnames;
25358 while (argname != first_kw_arg) {
25359 if ((**argname == key) || (
25360 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
25361 && _PyString_Eq(**argname, key))) {
25362 goto arg_passed_twice;
25369 if (likely(PyUnicode_Check(key))) {
25371 int cmp = (**name == key) ? 0 :
25372 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
25373 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
25375 PyUnicode_Compare(**name, key);
25376 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
25378 values[name-argnames] = value;
25383 if (*name)
continue;
25385 PyObject*** argname = argnames;
25386 while (argname != first_kw_arg) {
25387 int cmp = (**argname == key) ? 0 :
25388 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
25389 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
25391 PyUnicode_Compare(**argname, key);
25392 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
25393 if (cmp == 0)
goto arg_passed_twice;
25398 goto invalid_keyword_type;
25400 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
25402 goto invalid_keyword;
25407 __Pyx_RaiseDoubleKeywordsError(function_name, key);
25409 invalid_keyword_type:
25410 PyErr_Format(PyExc_TypeError,
25411 "%.200s() keywords must be strings", function_name);
25414 PyErr_Format(PyExc_TypeError,
25415 #
if PY_MAJOR_VERSION < 3
25416 "%.200s() got an unexpected keyword argument '%.200s'",
25417 function_name, PyString_AsString(key));
25419 "%s() got an unexpected keyword argument '%U'",
25420 function_name, key);
25427 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
25429 if (unlikely(!type)) {
25430 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25434 #if PY_MAJOR_VERSION == 2
25435 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
25439 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
25441 PyErr_Format(PyExc_TypeError,
25442 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25443 name, type->tp_name, Py_TYPE(obj)->tp_name);
25448 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
25454 S.u32 = 0x01020304;
25455 return S.u8[0] == 4;
25459 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
25460 __Pyx_BufFmt_StackElem* stack,
25461 __Pyx_TypeInfo* type) {
25462 stack[0].field = &ctx->root;
25463 stack[0].parent_offset = 0;
25464 ctx->root.type = type;
25465 ctx->root.name =
"buffer dtype";
25466 ctx->root.offset = 0;
25468 ctx->head->field = &ctx->root;
25469 ctx->fmt_offset = 0;
25470 ctx->head->parent_offset = 0;
25471 ctx->new_packmode =
'@';
25472 ctx->enc_packmode =
'@';
25473 ctx->new_count = 1;
25474 ctx->enc_count = 0;
25476 ctx->is_complex = 0;
25477 ctx->is_valid_array = 0;
25478 ctx->struct_alignment = 0;
25479 while (type->typegroup ==
'S') {
25481 ctx->head->field = type->fields;
25482 ctx->head->parent_offset = 0;
25483 type = type->fields->type;
25486 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
25488 const char* t = *ts;
25489 if (*t < '0' || *t >
'9') {
25492 count = *t++ -
'0';
25493 while (*t >=
'0' && *t <
'9') {
25495 count += *t++ -
'0';
25501 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
25502 int number = __Pyx_BufFmt_ParseNumber(ts);
25504 PyErr_Format(PyExc_ValueError,\
25505 "Does not understand character buffer dtype format string ('%c')", **ts);
25508 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
25509 PyErr_Format(PyExc_ValueError,
25510 "Unexpected format string character: '%c'", ch);
25512 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
25514 case 'c':
return "'char'";
25515 case 'b':
return "'signed char'";
25516 case 'B':
return "'unsigned char'";
25517 case 'h':
return "'short'";
25518 case 'H':
return "'unsigned short'";
25519 case 'i':
return "'int'";
25520 case 'I':
return "'unsigned int'";
25521 case 'l':
return "'long'";
25522 case 'L':
return "'unsigned long'";
25523 case 'q':
return "'long long'";
25524 case 'Q':
return "'unsigned long long'";
25525 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
25526 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
25527 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
25528 case 'T':
return "a struct";
25529 case 'O':
return "Python object";
25530 case 'P':
return "a pointer";
25531 case 's':
case 'p':
return "a string";
25532 case 0:
return "end";
25533 default:
return "unparseable format string";
25536 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
25538 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25539 case 'h':
case 'H':
return 2;
25540 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
25541 case 'q':
case 'Q':
return 8;
25542 case 'f':
return (is_complex ? 8 : 4);
25543 case 'd':
return (is_complex ? 16 : 8);
25545 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
25548 case 'O':
case 'P':
return sizeof(
void*);
25550 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25554 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
25556 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25557 case 'h':
case 'H':
return sizeof(short);
25558 case 'i':
case 'I':
return sizeof(int);
25559 case 'l':
case 'L':
return sizeof(long);
25560 #ifdef HAVE_LONG_LONG
25561 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
25563 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
25564 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
25565 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
25566 case 'O':
case 'P':
return sizeof(
void*);
25568 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25573 typedef struct {
char c;
short x; } __Pyx_st_short;
25574 typedef struct {
char c;
int x; } __Pyx_st_int;
25575 typedef struct {
char c;
long x; } __Pyx_st_long;
25576 typedef struct {
char c;
float x; } __Pyx_st_float;
25577 typedef struct {
char c;
double x; } __Pyx_st_double;
25578 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
25579 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
25580 #ifdef HAVE_LONG_LONG
25581 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
25583 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
25585 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25586 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
25587 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
25588 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
25589 #ifdef HAVE_LONG_LONG
25590 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
25592 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
25593 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
25594 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
25595 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
25597 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25605 typedef struct {
short x;
char c; } __Pyx_pad_short;
25606 typedef struct {
int x;
char c; } __Pyx_pad_int;
25607 typedef struct {
long x;
char c; } __Pyx_pad_long;
25608 typedef struct {
float x;
char c; } __Pyx_pad_float;
25609 typedef struct {
double x;
char c; } __Pyx_pad_double;
25610 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
25611 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
25612 #ifdef HAVE_LONG_LONG
25613 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
25615 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
25617 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
25618 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
25619 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
25620 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
25621 #ifdef HAVE_LONG_LONG
25622 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
25624 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
25625 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
25626 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
25627 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
25629 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25633 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
25637 case 'b':
case 'h':
case 'i':
25638 case 'l':
case 'q':
case 's':
case 'p':
25640 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
25642 case 'f':
case 'd':
case 'g':
25643 return (is_complex ?
'C' :
'R');
25649 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25654 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
25655 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
25656 const char* expected;
25658 if (ctx->head == NULL) {
25662 expected = ctx->head->field->type->name;
25665 PyErr_Format(PyExc_ValueError,
25666 "Buffer dtype mismatch, expected %s%s%s but got %s",
25667 quote, expected, quote,
25668 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
25670 __Pyx_StructField* field = ctx->head->field;
25671 __Pyx_StructField* parent = (ctx->head - 1)->field;
25672 PyErr_Format(PyExc_ValueError,
25673 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
25674 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
25675 parent->type->name, field->name);
25678 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
25680 size_t size, offset, arraysize = 1;
25681 if (ctx->enc_type == 0)
return 0;
25682 if (ctx->head->field->type->arraysize[0]) {
25684 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
25685 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
25687 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
25688 PyErr_Format(PyExc_ValueError,
25689 "Expected a dimension of size %zu, got %zu",
25690 ctx->head->field->type->arraysize[0], ctx->enc_count);
25694 if (!ctx->is_valid_array) {
25695 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
25696 ctx->head->field->type->ndim, ndim);
25699 for (i = 0; i < ctx->head->field->type->ndim; i++) {
25700 arraysize *= ctx->head->field->type->arraysize[i];
25702 ctx->is_valid_array = 0;
25703 ctx->enc_count = 1;
25705 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
25707 __Pyx_StructField* field = ctx->head->field;
25708 __Pyx_TypeInfo* type = field->type;
25709 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
25710 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
25712 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
25714 if (ctx->enc_packmode ==
'@') {
25715 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
25716 size_t align_mod_offset;
25717 if (align_at == 0)
return -1;
25718 align_mod_offset = ctx->fmt_offset % align_at;
25719 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
25720 if (ctx->struct_alignment == 0)
25721 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
25724 if (type->size != size || type->typegroup != group) {
25725 if (type->typegroup ==
'C' && type->fields != NULL) {
25726 size_t parent_offset = ctx->head->parent_offset + field->offset;
25728 ctx->head->field = type->fields;
25729 ctx->head->parent_offset = parent_offset;
25732 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
25734 __Pyx_BufFmt_RaiseExpected(ctx);
25738 offset = ctx->head->parent_offset + field->offset;
25739 if (ctx->fmt_offset != offset) {
25740 PyErr_Format(PyExc_ValueError,
25741 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
25742 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
25745 ctx->fmt_offset += size;
25747 ctx->fmt_offset += (arraysize - 1) * size;
25750 if (field == &ctx->root) {
25752 if (ctx->enc_count != 0) {
25753 __Pyx_BufFmt_RaiseExpected(ctx);
25758 ctx->head->field = ++field;
25759 if (field->type == NULL) {
25761 field = ctx->head->field;
25763 }
else if (field->type->typegroup ==
'S') {
25764 size_t parent_offset = ctx->head->parent_offset + field->offset;
25765 if (field->type->fields->type == NULL)
continue;
25766 field = field->type->fields;
25768 ctx->head->field = field;
25769 ctx->head->parent_offset = parent_offset;
25775 }
while (ctx->enc_count);
25777 ctx->is_complex = 0;
25781 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
25783 const char *ts = *tsp;
25785 int ndim = ctx->head->field->type->ndim;
25788 if (ctx->new_count != 1) {
25789 PyErr_SetString(PyExc_ValueError,
25790 "Cannot handle repeated arrays in format string");
25793 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25794 while (*ts && *ts !=
')') {
25796 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
25799 number = __Pyx_BufFmt_ExpectNumber(&ts);
25800 if (
number == -1)
return NULL;
25801 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
25802 return PyErr_Format(PyExc_ValueError,
25803 "Expected a dimension of size %zu, got %d",
25804 ctx->head->field->type->arraysize[i],
number);
25805 if (*ts !=
',' && *ts !=
')')
25806 return PyErr_Format(PyExc_ValueError,
25807 "Expected a comma in format string, got '%c'", *ts);
25808 if (*ts ==
',') ts++;
25812 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
25813 ctx->head->field->type->ndim, i);
25815 PyErr_SetString(PyExc_ValueError,
25816 "Unexpected end of format string, expected ')'");
25819 ctx->is_valid_array = 1;
25820 ctx->new_count = 1;
25824 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
25829 if (ctx->enc_type != 0 && ctx->head == NULL) {
25830 __Pyx_BufFmt_RaiseExpected(ctx);
25833 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25834 if (ctx->head != NULL) {
25835 __Pyx_BufFmt_RaiseExpected(ctx);
25845 if (!__Pyx_Is_Little_Endian()) {
25846 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
25849 ctx->new_packmode =
'=';
25854 if (__Pyx_Is_Little_Endian()) {
25855 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
25858 ctx->new_packmode =
'=';
25864 ctx->new_packmode = *ts++;
25868 const char* ts_after_sub;
25869 size_t i, struct_count = ctx->new_count;
25870 size_t struct_alignment = ctx->struct_alignment;
25871 ctx->new_count = 1;
25874 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
25877 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25879 ctx->enc_count = 0;
25880 ctx->struct_alignment = 0;
25883 for (i = 0; i != struct_count; ++i) {
25884 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
25885 if (!ts_after_sub)
return NULL;
25888 if (struct_alignment) ctx->struct_alignment = struct_alignment;
25893 size_t alignment = ctx->struct_alignment;
25895 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25897 if (alignment && ctx->fmt_offset % alignment) {
25898 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
25903 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25904 ctx->fmt_offset += ctx->new_count;
25905 ctx->new_count = 1;
25906 ctx->enc_count = 0;
25908 ctx->enc_packmode = ctx->new_packmode;
25914 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
25915 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
25918 CYTHON_FALLTHROUGH;
25919 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
25920 case 'l':
case 'L':
case 'q':
case 'Q':
25921 case 'f':
case 'd':
case 'g':
25922 case 'O':
case 'p':
25923 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
25924 ctx->enc_packmode == ctx->new_packmode) {
25925 ctx->enc_count += ctx->new_count;
25926 ctx->new_count = 1;
25931 CYTHON_FALLTHROUGH;
25933 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25934 ctx->enc_count = ctx->new_count;
25935 ctx->enc_packmode = ctx->new_packmode;
25936 ctx->enc_type = *ts;
25937 ctx->is_complex = got_Z;
25939 ctx->new_count = 1;
25944 while(*ts !=
':') ++ts;
25948 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
25952 int number = __Pyx_BufFmt_ExpectNumber(&ts);
25953 if (
number == -1)
return NULL;
25954 ctx->new_count = (size_t)
number;
25961 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
25962 if (unlikely(info->buf == NULL))
return;
25963 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
25964 __Pyx_ReleaseBuffer(info);
25966 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
25969 buf->strides = __Pyx_zeros;
25970 buf->shape = __Pyx_zeros;
25971 buf->suboffsets = __Pyx_minusones;
25973 static int __Pyx__GetBufferAndValidate(
25974 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
25975 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
25978 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
25979 __Pyx_ZeroBuffer(buf);
25982 if (unlikely(buf->ndim != nd)) {
25983 PyErr_Format(PyExc_ValueError,
25984 "Buffer has wrong number of dimensions (expected %d, got %d)",
25989 __Pyx_BufFmt_Context ctx;
25990 __Pyx_BufFmt_Init(&ctx, stack, dtype);
25991 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
25993 if (unlikely((
unsigned)buf->itemsize != dtype->size)) {
25994 PyErr_Format(PyExc_ValueError,
25995 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
25996 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
25997 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
26000 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
26003 __Pyx_SafeReleaseBuffer(buf);
26008 static void __Pyx_RaiseBufferIndexError(
int axis) {
26009 PyErr_Format(PyExc_IndexError,
26010 "Out of bounds on buffer access (axis %d)", axis);
26014 #if CYTHON_FAST_THREAD_STATE
26015 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26016 PyObject *tmp_type, *tmp_value, *tmp_tb;
26017 tmp_type = tstate->curexc_type;
26018 tmp_value = tstate->curexc_value;
26019 tmp_tb = tstate->curexc_traceback;
26020 tstate->curexc_type = type;
26021 tstate->curexc_value = value;
26022 tstate->curexc_traceback = tb;
26023 Py_XDECREF(tmp_type);
26024 Py_XDECREF(tmp_value);
26025 Py_XDECREF(tmp_tb);
26027 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26028 *type = tstate->curexc_type;
26029 *value = tstate->curexc_value;
26030 *tb = tstate->curexc_traceback;
26031 tstate->curexc_type = 0;
26032 tstate->curexc_value = 0;
26033 tstate->curexc_traceback = 0;
26038 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
26039 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
26041 value = PyDict_GetItemWithError(d, key);
26042 if (unlikely(!value)) {
26043 if (!PyErr_Occurred()) {
26044 PyObject* args = PyTuple_Pack(1, key);
26046 PyErr_SetObject(PyExc_KeyError, args);
26057 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
26059 if (!j)
return NULL;
26060 r = PyObject_GetItem(o, j);
26064 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
26065 CYTHON_NCP_UNUSED
int wraparound,
26066 CYTHON_NCP_UNUSED
int boundscheck) {
26067 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26068 Py_ssize_t wrapped_i = i;
26069 if (wraparound & unlikely(i < 0)) {
26070 wrapped_i += PyList_GET_SIZE(o);
26072 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
26073 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
26077 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
26079 return PySequence_GetItem(o, i);
26082 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
26083 CYTHON_NCP_UNUSED
int wraparound,
26084 CYTHON_NCP_UNUSED
int boundscheck) {
26085 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26086 Py_ssize_t wrapped_i = i;
26087 if (wraparound & unlikely(i < 0)) {
26088 wrapped_i += PyTuple_GET_SIZE(o);
26090 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
26091 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
26095 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
26097 return PySequence_GetItem(o, i);
26100 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
26101 CYTHON_NCP_UNUSED
int wraparound,
26102 CYTHON_NCP_UNUSED
int boundscheck) {
26103 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
26104 if (is_list || PyList_CheckExact(o)) {
26105 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
26106 if ((!boundscheck) || (likely((
n >= 0) & (
n < PyList_GET_SIZE(o))))) {
26107 PyObject *
r = PyList_GET_ITEM(o,
n);
26112 else if (PyTuple_CheckExact(o)) {
26113 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
26114 if ((!boundscheck) || likely((
n >= 0) & (
n < PyTuple_GET_SIZE(o)))) {
26115 PyObject *
r = PyTuple_GET_ITEM(o,
n);
26120 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
26121 if (likely(m && m->sq_item)) {
26122 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
26123 Py_ssize_t l = m->sq_length(o);
26124 if (likely(l >= 0)) {
26127 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
26132 return m->sq_item(o, i);
26136 if (is_list || PySequence_Check(o)) {
26137 return PySequence_GetItem(o, i);
26140 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
26144 #if CYTHON_USE_TYPE_SLOTS
26145 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
26147 Py_ssize_t key_value;
26148 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
26149 if (unlikely(!(m && m->sq_item))) {
26150 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
26153 key_value = __Pyx_PyIndex_AsSsize_t(index);
26154 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
26155 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
26157 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
26159 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
26163 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
26164 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
26165 if (likely(m && m->mp_subscript)) {
26166 return m->mp_subscript(obj, key);
26168 return __Pyx_PyObject_GetIndex(obj, key);
26173 #if !CYTHON_COMPILING_IN_PYPY
26174 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
26175 const double b = floatval;
26177 if (likely(PyFloat_CheckExact(op1))) {
26178 a = PyFloat_AS_DOUBLE(op1);
26180 #if PY_MAJOR_VERSION < 3
26181 if (likely(PyInt_CheckExact(op1))) {
26182 a = (double) PyInt_AS_LONG(op1);
26185 if (likely(PyLong_CheckExact(op1))) {
26186 #if CYTHON_USE_PYLONG_INTERNALS
26187 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26188 const Py_ssize_t size = Py_SIZE(op1);
26190 case 0: a = 0.0;
break;
26191 case -1: a = -(double) digits[0];
break;
26192 case 1: a = (double) digits[0];
break;
26195 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
26196 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26197 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
26203 CYTHON_FALLTHROUGH;
26206 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
26207 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26208 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
26214 CYTHON_FALLTHROUGH;
26217 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
26218 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26219 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
26225 CYTHON_FALLTHROUGH;
26230 a = PyLong_AsDouble(op1);
26231 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
26234 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26236 PyFPE_START_PROTECT(
"add",
return NULL)
26238 PyFPE_END_PROTECT(result)
26239 return PyFloat_FromDouble(result);
26244 #if CYTHON_FAST_PYCALL
26245 #include "frameobject.h"
26246 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
26247 PyObject *globals) {
26249 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26250 PyObject **fastlocals;
26253 assert(globals != NULL);
26258 assert(tstate != NULL);
26259 f = PyFrame_New(tstate, co, globals, NULL);
26263 fastlocals =
f->f_localsplus;
26264 for (i = 0; i < na; i++) {
26266 fastlocals[i] = *args++;
26268 result = PyEval_EvalFrameEx(
f,0);
26269 ++tstate->recursion_depth;
26271 --tstate->recursion_depth;
26274 #if 1 || PY_VERSION_HEX < 0x030600B1
26275 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
26276 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
26277 PyObject *globals = PyFunction_GET_GLOBALS(func);
26278 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
26280 #if PY_MAJOR_VERSION >= 3
26283 PyObject *kwtuple, **k;
26288 assert(kwargs == NULL || PyDict_Check(kwargs));
26289 nk = kwargs ? PyDict_Size(kwargs) : 0;
26290 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
26294 #
if PY_MAJOR_VERSION >= 3
26295 co->co_kwonlyargcount == 0 &&
26297 likely(kwargs == NULL || nk == 0) &&
26298 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
26299 if (argdefs == NULL && co->co_argcount == nargs) {
26300 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
26303 else if (nargs == 0 && argdefs != NULL
26304 && co->co_argcount == Py_SIZE(argdefs)) {
26307 args = &PyTuple_GET_ITEM(argdefs, 0);
26308 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
26312 if (kwargs != NULL) {
26314 kwtuple = PyTuple_New(2 * nk);
26315 if (kwtuple == NULL) {
26319 k = &PyTuple_GET_ITEM(kwtuple, 0);
26321 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
26332 closure = PyFunction_GET_CLOSURE(func);
26333 #if PY_MAJOR_VERSION >= 3
26334 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
26336 if (argdefs != NULL) {
26337 d = &PyTuple_GET_ITEM(argdefs, 0);
26338 nd = Py_SIZE(argdefs);
26344 #if PY_MAJOR_VERSION >= 3
26345 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
26348 d, (
int)nd, kwdefs, closure);
26350 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
26353 d, (
int)nd, closure);
26355 Py_XDECREF(kwtuple);
26357 Py_LeaveRecursiveCall();
26364 #if CYTHON_FAST_PYCCALL
26365 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
26366 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
26367 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
26368 PyObject *
self = PyCFunction_GET_SELF(func);
26369 int flags = PyCFunction_GET_FLAGS(func);
26370 assert(PyCFunction_Check(func));
26371 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
26372 assert(nargs >= 0);
26373 assert(nargs == 0 || args != NULL);
26377 assert(!PyErr_Occurred());
26378 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
26379 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
26381 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
26387 #if CYTHON_COMPILING_IN_CPYTHON
26388 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26390 ternaryfunc call = func->ob_type->tp_call;
26391 if (unlikely(!call))
26392 return PyObject_Call(func, arg, kw);
26393 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
26395 result = (*call)(func, arg, kw);
26396 Py_LeaveRecursiveCall();
26397 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26400 "NULL result without error in PyObject_Call");
26407 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
26409 #if !CYTHON_AVOID_BORROWED_REFS
26410 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
26411 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
26412 if (likely(result)) {
26414 }
else if (unlikely(PyErr_Occurred())) {
26418 result = PyDict_GetItem(__pyx_d, name);
26419 if (likely(result)) {
26424 result = PyObject_GetItem(__pyx_d, name);
26428 result = __Pyx_GetBuiltinName(name);
26434 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26435 if (unlikely(!type)) {
26436 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26439 if (likely(__Pyx_TypeCheck(obj, type)))
26441 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
26442 Py_TYPE(obj)->tp_name, type->tp_name);
26447 #if CYTHON_COMPILING_IN_CPYTHON
26448 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
26449 PyObject *
self, *result;
26451 cfunc = PyCFunction_GET_FUNCTION(func);
26452 self = PyCFunction_GET_SELF(func);
26453 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
26455 result = cfunc(
self, arg);
26456 Py_LeaveRecursiveCall();
26457 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26460 "NULL result without error in PyObject_Call");
26467 #if CYTHON_COMPILING_IN_CPYTHON
26468 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26470 PyObject *args = PyTuple_New(1);
26471 if (unlikely(!args))
return NULL;
26473 PyTuple_SET_ITEM(args, 0, arg);
26474 result = __Pyx_PyObject_Call(func, args, NULL);
26478 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26479 #if CYTHON_FAST_PYCALL
26480 if (PyFunction_Check(func)) {
26481 return __Pyx_PyFunction_FastCall(func, &arg, 1);
26484 if (likely(PyCFunction_Check(func))) {
26485 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
26486 return __Pyx_PyObject_CallMethO(func, arg);
26487 #if CYTHON_FAST_PYCCALL
26488 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
26489 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
26493 return __Pyx__PyObject_CallOneArg(func, arg);
26496 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
26498 PyObject *args = PyTuple_Pack(1, arg);
26499 if (unlikely(!args))
return NULL;
26500 result = __Pyx_PyObject_Call(func, args, NULL);
26507 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
26508 PyObject* float_value;
26509 #if !CYTHON_USE_TYPE_SLOTS
26510 float_value = PyNumber_Float(obj);
if (0)
goto bad;
26512 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
26513 if (likely(nb) && likely(nb->nb_float)) {
26514 float_value = nb->nb_float(obj);
26515 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
26516 PyErr_Format(PyExc_TypeError,
26517 "__float__ returned non-float (type %.200s)",
26518 Py_TYPE(float_value)->tp_name);
26519 Py_DECREF(float_value);
26522 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
26523 #if PY_MAJOR_VERSION >= 3
26524 float_value = PyFloat_FromString(obj);
26526 float_value = PyFloat_FromString(obj, 0);
26529 PyObject* args = PyTuple_New(1);
26530 if (unlikely(!args))
goto bad;
26531 PyTuple_SET_ITEM(args, 0, obj);
26532 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
26533 PyTuple_SET_ITEM(args, 0, 0);
26537 if (likely(float_value)) {
26538 double value = PyFloat_AS_DOUBLE(float_value);
26539 Py_DECREF(float_value);
26547 #if PY_MAJOR_VERSION < 3
26548 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
26549 CYTHON_UNUSED PyObject *cause) {
26550 __Pyx_PyThreadState_declare
26552 if (!value || value == Py_None)
26556 if (!tb || tb == Py_None)
26560 if (!PyTraceBack_Check(tb)) {
26561 PyErr_SetString(PyExc_TypeError,
26562 "raise: arg 3 must be a traceback or None");
26566 if (PyType_Check(type)) {
26567 #if CYTHON_COMPILING_IN_PYPY
26569 Py_INCREF(Py_None);
26573 PyErr_NormalizeException(&type, &value, &tb);
26576 PyErr_SetString(PyExc_TypeError,
26577 "instance exception may not have a separate value");
26581 type = (PyObject*) Py_TYPE(type);
26583 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26584 PyErr_SetString(PyExc_TypeError,
26585 "raise: exception class must be a subclass of BaseException");
26589 __Pyx_PyThreadState_assign
26590 __Pyx_ErrRestore(type, value, tb);
26599 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26600 PyObject* owned_instance = NULL;
26601 if (tb == Py_None) {
26603 }
else if (tb && !PyTraceBack_Check(tb)) {
26604 PyErr_SetString(PyExc_TypeError,
26605 "raise: arg 3 must be a traceback or None");
26608 if (value == Py_None)
26610 if (PyExceptionInstance_Check(type)) {
26612 PyErr_SetString(PyExc_TypeError,
26613 "instance exception may not have a separate value");
26617 type = (PyObject*) Py_TYPE(value);
26618 }
else if (PyExceptionClass_Check(type)) {
26619 PyObject *instance_class = NULL;
26620 if (value && PyExceptionInstance_Check(value)) {
26621 instance_class = (PyObject*) Py_TYPE(value);
26622 if (instance_class != type) {
26623 int is_subclass = PyObject_IsSubclass(instance_class, type);
26624 if (!is_subclass) {
26625 instance_class = NULL;
26626 }
else if (unlikely(is_subclass == -1)) {
26629 type = instance_class;
26633 if (!instance_class) {
26636 args = PyTuple_New(0);
26637 else if (PyTuple_Check(value)) {
26641 args = PyTuple_Pack(1, value);
26644 owned_instance = PyObject_Call(type, args, NULL);
26646 if (!owned_instance)
26648 value = owned_instance;
26649 if (!PyExceptionInstance_Check(value)) {
26650 PyErr_Format(PyExc_TypeError,
26651 "calling %R should have returned an instance of "
26652 "BaseException, not %R",
26653 type, Py_TYPE(value));
26658 PyErr_SetString(PyExc_TypeError,
26659 "raise: exception class must be a subclass of BaseException");
26663 PyObject *fixed_cause;
26664 if (cause == Py_None) {
26665 fixed_cause = NULL;
26666 }
else if (PyExceptionClass_Check(cause)) {
26667 fixed_cause = PyObject_CallObject(cause, NULL);
26668 if (fixed_cause == NULL)
26670 }
else if (PyExceptionInstance_Check(cause)) {
26671 fixed_cause = cause;
26672 Py_INCREF(fixed_cause);
26674 PyErr_SetString(PyExc_TypeError,
26675 "exception causes must derive from "
26679 PyException_SetCause(value, fixed_cause);
26681 PyErr_SetObject(type, value);
26683 #if CYTHON_COMPILING_IN_PYPY
26684 PyObject *tmp_type, *tmp_value, *tmp_tb;
26685 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26687 PyErr_Restore(tmp_type, tmp_value, tb);
26688 Py_XDECREF(tmp_tb);
26690 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26691 PyObject* tmp_tb = tstate->curexc_traceback;
26692 if (tb != tmp_tb) {
26694 tstate->curexc_traceback = tb;
26695 Py_XDECREF(tmp_tb);
26700 Py_XDECREF(owned_instance);
26706 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26707 PyErr_Format(PyExc_ValueError,
26708 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
26712 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26713 PyErr_Format(PyExc_ValueError,
26714 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
26715 index, (index == 1) ?
"" :
"s");
26719 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
26720 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
26724 #if CYTHON_FAST_THREAD_STATE
26725 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26726 #if PY_VERSION_HEX >= 0x030700A3
26727 *type = tstate->exc_state.exc_type;
26728 *value = tstate->exc_state.exc_value;
26729 *tb = tstate->exc_state.exc_traceback;
26731 *type = tstate->exc_type;
26732 *value = tstate->exc_value;
26733 *tb = tstate->exc_traceback;
26736 Py_XINCREF(*value);
26739 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26740 PyObject *tmp_type, *tmp_value, *tmp_tb;
26741 #if PY_VERSION_HEX >= 0x030700A3
26742 tmp_type = tstate->exc_state.exc_type;
26743 tmp_value = tstate->exc_state.exc_value;
26744 tmp_tb = tstate->exc_state.exc_traceback;
26745 tstate->exc_state.exc_type = type;
26746 tstate->exc_state.exc_value = value;
26747 tstate->exc_state.exc_traceback = tb;
26749 tmp_type = tstate->exc_type;
26750 tmp_value = tstate->exc_value;
26751 tmp_tb = tstate->exc_traceback;
26752 tstate->exc_type = type;
26753 tstate->exc_value = value;
26754 tstate->exc_traceback = tb;
26756 Py_XDECREF(tmp_type);
26757 Py_XDECREF(tmp_value);
26758 Py_XDECREF(tmp_tb);
26763 #if CYTHON_FAST_THREAD_STATE
26764 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26766 n = PyTuple_GET_SIZE(tuple);
26767 #if PY_MAJOR_VERSION >= 3
26768 for (i=0; i<
n; i++) {
26769 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26772 for (i=0; i<
n; i++) {
26773 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
26777 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
26778 PyObject *exc_type = tstate->curexc_type;
26779 if (exc_type == err)
return 1;
26780 if (unlikely(!exc_type))
return 0;
26781 if (unlikely(PyTuple_Check(err)))
26782 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
26783 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
26788 #if CYTHON_FAST_THREAD_STATE
26789 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26791 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
26793 PyObject *local_type, *local_value, *local_tb;
26794 #if CYTHON_FAST_THREAD_STATE
26795 PyObject *tmp_type, *tmp_value, *tmp_tb;
26796 local_type = tstate->curexc_type;
26797 local_value = tstate->curexc_value;
26798 local_tb = tstate->curexc_traceback;
26799 tstate->curexc_type = 0;
26800 tstate->curexc_value = 0;
26801 tstate->curexc_traceback = 0;
26803 PyErr_Fetch(&local_type, &local_value, &local_tb);
26805 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26806 #if CYTHON_FAST_THREAD_STATE
26807 if (unlikely(tstate->curexc_type))
26809 if (unlikely(PyErr_Occurred()))
26812 #if PY_MAJOR_VERSION >= 3
26814 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26818 Py_XINCREF(local_tb);
26819 Py_XINCREF(local_type);
26820 Py_XINCREF(local_value);
26821 *type = local_type;
26822 *value = local_value;
26824 #if CYTHON_FAST_THREAD_STATE
26825 #if PY_VERSION_HEX >= 0x030700A3
26826 tmp_type = tstate->exc_state.exc_type;
26827 tmp_value = tstate->exc_state.exc_value;
26828 tmp_tb = tstate->exc_state.exc_traceback;
26829 tstate->exc_state.exc_type = local_type;
26830 tstate->exc_state.exc_value = local_value;
26831 tstate->exc_state.exc_traceback = local_tb;
26833 tmp_type = tstate->exc_type;
26834 tmp_value = tstate->exc_value;
26835 tmp_tb = tstate->exc_traceback;
26836 tstate->exc_type = local_type;
26837 tstate->exc_value = local_value;
26838 tstate->exc_traceback = local_tb;
26840 Py_XDECREF(tmp_type);
26841 Py_XDECREF(tmp_value);
26842 Py_XDECREF(tmp_tb);
26844 PyErr_SetExcInfo(local_type, local_value, local_tb);
26851 Py_XDECREF(local_type);
26852 Py_XDECREF(local_value);
26853 Py_XDECREF(local_tb);
26858 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
26859 PyObject *empty_list = 0;
26860 PyObject *module = 0;
26861 PyObject *global_dict = 0;
26862 PyObject *empty_dict = 0;
26864 #if PY_MAJOR_VERSION < 3
26865 PyObject *py_import;
26866 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
26873 empty_list = PyList_New(0);
26878 global_dict = PyModule_GetDict(__pyx_m);
26881 empty_dict = PyDict_New();
26885 #if PY_MAJOR_VERSION >= 3
26887 if (strchr(__Pyx_MODULE_NAME,
'.')) {
26888 module = PyImport_ImportModuleLevelObject(
26889 name, global_dict, empty_dict, list, 1);
26891 if (!PyErr_ExceptionMatches(PyExc_ImportError))
26900 #if PY_MAJOR_VERSION < 3
26901 PyObject *py_level = PyInt_FromLong(level);
26904 module = PyObject_CallFunctionObjArgs(py_import,
26905 name, global_dict, empty_dict, list, py_level, NULL);
26906 Py_DECREF(py_level);
26908 module = PyImport_ImportModuleLevelObject(
26909 name, global_dict, empty_dict, list, level);
26914 #if PY_MAJOR_VERSION < 3
26915 Py_XDECREF(py_import);
26917 Py_XDECREF(empty_list);
26918 Py_XDECREF(empty_dict);
26923 #ifndef CYTHON_CLINE_IN_TRACEBACK
26924 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
26925 PyObject *use_cline;
26926 PyObject *ptype, *pvalue, *ptraceback;
26927 #if CYTHON_COMPILING_IN_CPYTHON
26928 PyObject **cython_runtime_dict;
26930 if (unlikely(!__pyx_cython_runtime)) {
26933 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26934 #if CYTHON_COMPILING_IN_CPYTHON
26935 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26936 if (likely(cython_runtime_dict)) {
26937 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
26941 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26942 if (use_cline_obj) {
26943 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26944 Py_DECREF(use_cline_obj);
26952 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26954 else if (PyObject_Not(use_cline) != 0) {
26957 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26963 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26964 int start = 0, mid = 0, end = count - 1;
26965 if (end >= 0 && code_line > entries[end].code_line) {
26968 while (start < end) {
26969 mid = start + (end - start) / 2;
26970 if (code_line < entries[mid].code_line) {
26972 }
else if (code_line > entries[mid].code_line) {
26978 if (code_line <= entries[mid].code_line) {
26984 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26985 PyCodeObject* code_object;
26987 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26990 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26991 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
26994 code_object = __pyx_code_cache.entries[
pos].code_object;
26995 Py_INCREF(code_object);
26996 return code_object;
26998 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27000 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27001 if (unlikely(!code_line)) {
27004 if (unlikely(!entries)) {
27005 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27006 if (likely(entries)) {
27007 __pyx_code_cache.entries = entries;
27008 __pyx_code_cache.max_count = 64;
27009 __pyx_code_cache.count = 1;
27010 entries[0].code_line = code_line;
27011 entries[0].code_object = code_object;
27012 Py_INCREF(code_object);
27016 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27017 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
27018 PyCodeObject* tmp = entries[
pos].code_object;
27019 entries[
pos].code_object = code_object;
27023 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27024 int new_max = __pyx_code_cache.max_count + 64;
27025 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27026 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
27027 if (unlikely(!entries)) {
27030 __pyx_code_cache.entries = entries;
27031 __pyx_code_cache.max_count = new_max;
27033 for (i=__pyx_code_cache.count; i>
pos; i--) {
27034 entries[i] = entries[i-1];
27036 entries[
pos].code_line = code_line;
27037 entries[
pos].code_object = code_object;
27038 __pyx_code_cache.count++;
27039 Py_INCREF(code_object);
27043 #include "compile.h"
27044 #include "frameobject.h"
27045 #include "traceback.h"
27046 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27047 const char *funcname,
int c_line,
27048 int py_line,
const char *filename) {
27049 PyCodeObject *py_code = 0;
27050 PyObject *py_srcfile = 0;
27051 PyObject *py_funcname = 0;
27052 #if PY_MAJOR_VERSION < 3
27053 py_srcfile = PyString_FromString(filename);
27055 py_srcfile = PyUnicode_FromString(filename);
27057 if (!py_srcfile)
goto bad;
27059 #if PY_MAJOR_VERSION < 3
27060 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27062 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27066 #if PY_MAJOR_VERSION < 3
27067 py_funcname = PyString_FromString(funcname);
27069 py_funcname = PyUnicode_FromString(funcname);
27072 if (!py_funcname)
goto bad;
27073 py_code = __Pyx_PyCode_New(
27090 Py_DECREF(py_srcfile);
27091 Py_DECREF(py_funcname);
27094 Py_XDECREF(py_srcfile);
27095 Py_XDECREF(py_funcname);
27098 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27099 int py_line,
const char *filename) {
27100 PyCodeObject *py_code = 0;
27101 PyFrameObject *py_frame = 0;
27102 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27104 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27106 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27108 py_code = __Pyx_CreateCodeObjectForTraceback(
27109 funcname, c_line, py_line, filename);
27110 if (!py_code)
goto bad;
27111 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27113 py_frame = PyFrame_New(
27119 if (!py_frame)
goto bad;
27120 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27121 PyTraceBack_Here(py_frame);
27123 Py_XDECREF(py_code);
27124 Py_XDECREF(py_frame);
27127 #if PY_MAJOR_VERSION < 3
27128 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27129 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27130 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27131 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27134 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27135 PyObject *obj = view->obj;
27137 if (PyObject_CheckBuffer(obj)) {
27138 PyBuffer_Release(view);
27142 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27150 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27151 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27152 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27153 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27154 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27156 func_type value = func_value;\
27157 if (sizeof(target_type) < sizeof(func_type)) {\
27158 if (unlikely(value != (func_type) (target_type) value)) {\
27159 func_type zero = 0;\
27160 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27161 return (target_type) -1;\
27162 if (is_unsigned && unlikely(value < zero))\
27163 goto raise_neg_overflow;\
27165 goto raise_overflow;\
27168 return (target_type) value;\
27172 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27173 const int neg_one = (int) -1, const_zero = (
int) 0;
27174 const int is_unsigned = neg_one > const_zero;
27176 if (
sizeof(
int) <
sizeof(long)) {
27177 return PyInt_FromLong((
long) value);
27178 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27179 return PyLong_FromUnsignedLong((
unsigned long) value);
27180 #ifdef HAVE_LONG_LONG
27181 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27182 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27186 if (
sizeof(
int) <=
sizeof(
long)) {
27187 return PyInt_FromLong((
long) value);
27188 #ifdef HAVE_LONG_LONG
27189 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27190 return PyLong_FromLongLong((PY_LONG_LONG) value);
27195 int one = 1;
int little = (int)*(
unsigned char *)&one;
27196 unsigned char *bytes = (
unsigned char *)&value;
27197 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27198 little, !is_unsigned);
27203 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
27204 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
27205 const int is_unsigned = neg_one > const_zero;
27207 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
27208 return PyInt_FromLong((
long) value);
27209 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
27210 return PyLong_FromUnsignedLong((
unsigned long) value);
27211 #ifdef HAVE_LONG_LONG
27212 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
27213 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27217 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
27218 return PyInt_FromLong((
long) value);
27219 #ifdef HAVE_LONG_LONG
27220 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
27221 return PyLong_FromLongLong((PY_LONG_LONG) value);
27226 int one = 1;
int little = (int)*(
unsigned char *)&one;
27227 unsigned char *bytes = (
unsigned char *)&value;
27228 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
27229 little, !is_unsigned);
27234 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27235 const long neg_one = (long) -1, const_zero = (
long) 0;
27236 const int is_unsigned = neg_one > const_zero;
27238 if (
sizeof(
long) <
sizeof(long)) {
27239 return PyInt_FromLong((
long) value);
27240 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27241 return PyLong_FromUnsignedLong((
unsigned long) value);
27242 #ifdef HAVE_LONG_LONG
27243 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27244 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27248 if (
sizeof(
long) <=
sizeof(
long)) {
27249 return PyInt_FromLong((
long) value);
27250 #ifdef HAVE_LONG_LONG
27251 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27252 return PyLong_FromLongLong((PY_LONG_LONG) value);
27257 int one = 1;
int little = (int)*(
unsigned char *)&one;
27258 unsigned char *bytes = (
unsigned char *)&value;
27259 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27260 little, !is_unsigned);
27265 #if CYTHON_CCOMPLEX
27267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27268 return ::std::complex< float >(x, y);
27271 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27272 return x + y*(__pyx_t_float_complex)_Complex_I;
27276 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27277 __pyx_t_float_complex
z;
27285 #if CYTHON_CCOMPLEX
27287 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27288 return (a.real == b.real) && (a.imag == b.imag);
27290 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27291 __pyx_t_float_complex
z;
27292 z.real = a.real + b.real;
27293 z.imag = a.imag + b.imag;
27296 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27297 __pyx_t_float_complex
z;
27298 z.real = a.real - b.real;
27299 z.imag = a.imag - b.imag;
27302 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27303 __pyx_t_float_complex
z;
27304 z.real = a.real * b.real - a.imag * b.imag;
27305 z.imag = a.real * b.imag + a.imag * b.real;
27309 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27311 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27312 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27313 if (b.real == 0 && b.imag == 0) {
27314 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27316 float r = b.imag / b.real;
27317 float s = 1.0 / (b.real + b.imag *
r);
27318 return __pyx_t_float_complex_from_parts(
27319 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27322 float r = b.real / b.imag;
27323 float s = 1.0 / (b.imag + b.real *
r);
27324 return __pyx_t_float_complex_from_parts(
27325 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27329 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27331 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27333 float denom = b.real * b.real + b.imag * b.imag;
27334 return __pyx_t_float_complex_from_parts(
27335 (a.real * b.real + a.imag * b.imag) / denom,
27336 (a.imag * b.real - a.real * b.imag) / denom);
27340 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27341 __pyx_t_float_complex
z;
27346 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27347 return (a.real == 0) && (a.imag == 0);
27349 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27350 __pyx_t_float_complex
z;
27356 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27357 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27358 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
27360 return hypotf(
z.real,
z.imag);
27363 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27364 __pyx_t_float_complex
z;
27365 float r, lnr, theta, z_r, z_theta;
27366 if (b.imag == 0 && b.real == (
int)b.real) {
27368 float denom = a.real * a.real + a.imag * a.imag;
27369 a.real = a.real / denom;
27370 a.imag = -a.imag / denom;
27373 switch ((
int)b.real) {
27381 z = __Pyx_c_prod_float(a, a);
27382 return __Pyx_c_prod_float(a, a);
27384 z = __Pyx_c_prod_float(a, a);
27385 return __Pyx_c_prod_float(
z, a);
27387 z = __Pyx_c_prod_float(a, a);
27388 return __Pyx_c_prod_float(
z,
z);
27394 }
else if (b.imag == 0) {
27395 z.real = powf(a.real, b.real);
27398 }
else if (a.real > 0) {
27403 theta = atan2f(0, -1);
27406 r = __Pyx_c_abs_float(a);
27407 theta = atan2f(a.imag, a.real);
27410 z_r = expf(lnr * b.real - theta * b.imag);
27411 z_theta = theta * b.real + lnr * b.imag;
27412 z.real = z_r * cosf(z_theta);
27413 z.imag = z_r * sinf(z_theta);
27420 #if CYTHON_CCOMPLEX
27422 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27423 return ::std::complex< double >(x, y);
27426 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27427 return x + y*(__pyx_t_double_complex)_Complex_I;
27431 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27432 __pyx_t_double_complex
z;
27440 #if CYTHON_CCOMPLEX
27442 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27443 return (a.real == b.real) && (a.imag == b.imag);
27445 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27446 __pyx_t_double_complex
z;
27447 z.real = a.real + b.real;
27448 z.imag = a.imag + b.imag;
27451 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27452 __pyx_t_double_complex
z;
27453 z.real = a.real - b.real;
27454 z.imag = a.imag - b.imag;
27457 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27458 __pyx_t_double_complex
z;
27459 z.real = a.real * b.real - a.imag * b.imag;
27460 z.imag = a.real * b.imag + a.imag * b.real;
27464 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27466 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27467 }
else if (fabs(b.real) >= fabs(b.imag)) {
27468 if (b.real == 0 && b.imag == 0) {
27469 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27471 double r = b.imag / b.real;
27472 double s = 1.0 / (b.real + b.imag *
r);
27473 return __pyx_t_double_complex_from_parts(
27474 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27477 double r = b.real / b.imag;
27478 double s = 1.0 / (b.imag + b.real *
r);
27479 return __pyx_t_double_complex_from_parts(
27480 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27484 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27486 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27488 double denom = b.real * b.real + b.imag * b.imag;
27489 return __pyx_t_double_complex_from_parts(
27490 (a.real * b.real + a.imag * b.imag) / denom,
27491 (a.imag * b.real - a.real * b.imag) / denom);
27495 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27496 __pyx_t_double_complex
z;
27501 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27502 return (a.real == 0) && (a.imag == 0);
27504 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27505 __pyx_t_double_complex
z;
27511 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27512 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27513 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
27515 return hypot(
z.real,
z.imag);
27518 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27519 __pyx_t_double_complex
z;
27520 double r, lnr, theta, z_r, z_theta;
27521 if (b.imag == 0 && b.real == (
int)b.real) {
27523 double denom = a.real * a.real + a.imag * a.imag;
27524 a.real = a.real / denom;
27525 a.imag = -a.imag / denom;
27528 switch ((
int)b.real) {
27536 z = __Pyx_c_prod_double(a, a);
27537 return __Pyx_c_prod_double(a, a);
27539 z = __Pyx_c_prod_double(a, a);
27540 return __Pyx_c_prod_double(
z, a);
27542 z = __Pyx_c_prod_double(a, a);
27543 return __Pyx_c_prod_double(
z,
z);
27549 }
else if (b.imag == 0) {
27550 z.real = pow(a.real, b.real);
27553 }
else if (a.real > 0) {
27558 theta = atan2(0, -1);
27561 r = __Pyx_c_abs_double(a);
27562 theta = atan2(a.imag, a.real);
27565 z_r = exp(lnr * b.real - theta * b.imag);
27566 z_theta = theta * b.real + lnr * b.imag;
27567 z.real = z_r * cos(z_theta);
27568 z.imag = z_r * sin(z_theta);
27575 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27576 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
27577 const int is_unsigned = neg_one > const_zero;
27579 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27580 return PyInt_FromLong((
long) value);
27581 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27582 return PyLong_FromUnsignedLong((
unsigned long) value);
27583 #ifdef HAVE_LONG_LONG
27584 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27585 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27589 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27590 return PyInt_FromLong((
long) value);
27591 #ifdef HAVE_LONG_LONG
27592 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27593 return PyLong_FromLongLong((PY_LONG_LONG) value);
27598 int one = 1;
int little = (int)*(
unsigned char *)&one;
27599 unsigned char *bytes = (
unsigned char *)&value;
27600 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27601 little, !is_unsigned);
27606 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27607 const int neg_one = (int) -1, const_zero = (
int) 0;
27608 const int is_unsigned = neg_one > const_zero;
27609 #if PY_MAJOR_VERSION < 3
27610 if (likely(PyInt_Check(x))) {
27611 if (
sizeof(
int) <
sizeof(long)) {
27612 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27614 long val = PyInt_AS_LONG(x);
27615 if (is_unsigned && unlikely(val < 0)) {
27616 goto raise_neg_overflow;
27622 if (likely(PyLong_Check(x))) {
27624 #if CYTHON_USE_PYLONG_INTERNALS
27625 const digit* digits = ((PyLongObject*)x)->ob_digit;
27626 switch (Py_SIZE(x)) {
27627 case 0:
return (
int) 0;
27628 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27630 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27631 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27632 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27633 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27634 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27639 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27640 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27641 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27642 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27643 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27648 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27649 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27650 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27651 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27652 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27658 #if CYTHON_COMPILING_IN_CPYTHON
27659 if (unlikely(Py_SIZE(x) < 0)) {
27660 goto raise_neg_overflow;
27664 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27665 if (unlikely(result < 0))
27667 if (unlikely(result == 1))
27668 goto raise_neg_overflow;
27671 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27672 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27673 #ifdef HAVE_LONG_LONG
27674 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27675 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27679 #if CYTHON_USE_PYLONG_INTERNALS
27680 const digit* digits = ((PyLongObject*)x)->ob_digit;
27681 switch (Py_SIZE(x)) {
27682 case 0:
return (
int) 0;
27683 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27684 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27686 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27687 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27688 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27689 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27690 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27695 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27696 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27697 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27698 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27699 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27704 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27705 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27706 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27707 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27708 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27713 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27714 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27715 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27716 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27717 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27722 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27723 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27724 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27725 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27726 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27731 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27732 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27733 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27734 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27735 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27741 if (
sizeof(
int) <=
sizeof(long)) {
27742 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27743 #ifdef HAVE_LONG_LONG
27744 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27745 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27750 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27751 PyErr_SetString(PyExc_RuntimeError,
27752 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27755 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27756 #if PY_MAJOR_VERSION < 3
27757 if (likely(
v) && !PyLong_Check(
v)) {
27759 v = PyNumber_Long(tmp);
27764 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27765 unsigned char *bytes = (
unsigned char *)&val;
27766 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27767 bytes,
sizeof(val),
27768 is_little, !is_unsigned);
27778 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27779 if (!tmp)
return (
int) -1;
27780 val = __Pyx_PyInt_As_int(tmp);
27785 PyErr_SetString(PyExc_OverflowError,
27786 "value too large to convert to int");
27788 raise_neg_overflow:
27789 PyErr_SetString(PyExc_OverflowError,
27790 "can't convert negative value to int");
27795 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
27796 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
27797 const int is_unsigned = neg_one > const_zero;
27798 #if PY_MAJOR_VERSION < 3
27799 if (likely(PyInt_Check(x))) {
27800 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
27801 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
27803 long val = PyInt_AS_LONG(x);
27804 if (is_unsigned && unlikely(val < 0)) {
27805 goto raise_neg_overflow;
27807 return (Py_intptr_t) val;
27811 if (likely(PyLong_Check(x))) {
27813 #if CYTHON_USE_PYLONG_INTERNALS
27814 const digit* digits = ((PyLongObject*)x)->ob_digit;
27815 switch (Py_SIZE(x)) {
27816 case 0:
return (Py_intptr_t) 0;
27817 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
27819 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
27820 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27821 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27822 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
27823 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
27828 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
27829 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27830 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27831 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
27832 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
27837 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
27838 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27839 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27840 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
27841 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
27847 #if CYTHON_COMPILING_IN_CPYTHON
27848 if (unlikely(Py_SIZE(x) < 0)) {
27849 goto raise_neg_overflow;
27853 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27854 if (unlikely(result < 0))
27855 return (Py_intptr_t) -1;
27856 if (unlikely(result == 1))
27857 goto raise_neg_overflow;
27860 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
27861 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
27862 #ifdef HAVE_LONG_LONG
27863 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
27864 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27868 #if CYTHON_USE_PYLONG_INTERNALS
27869 const digit* digits = ((PyLongObject*)x)->ob_digit;
27870 switch (Py_SIZE(x)) {
27871 case 0:
return (Py_intptr_t) 0;
27872 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
27873 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
27875 if (8 *
sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
27876 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27877 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27878 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
27879 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27884 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
27885 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27886 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27887 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
27888 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27893 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
27894 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27895 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27896 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
27897 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27902 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
27903 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27904 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27905 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
27906 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27911 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
27912 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27913 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27914 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
27915 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27920 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
27921 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27922 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27923 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
27924 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
27930 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
27931 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
27932 #ifdef HAVE_LONG_LONG
27933 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
27934 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
27939 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27940 PyErr_SetString(PyExc_RuntimeError,
27941 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27944 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27945 #if PY_MAJOR_VERSION < 3
27946 if (likely(
v) && !PyLong_Check(
v)) {
27948 v = PyNumber_Long(tmp);
27953 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27954 unsigned char *bytes = (
unsigned char *)&val;
27955 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27956 bytes,
sizeof(val),
27957 is_little, !is_unsigned);
27963 return (Py_intptr_t) -1;
27967 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27968 if (!tmp)
return (Py_intptr_t) -1;
27969 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
27974 PyErr_SetString(PyExc_OverflowError,
27975 "value too large to convert to Py_intptr_t");
27976 return (Py_intptr_t) -1;
27977 raise_neg_overflow:
27978 PyErr_SetString(PyExc_OverflowError,
27979 "can't convert negative value to Py_intptr_t");
27980 return (Py_intptr_t) -1;
27984 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
27985 const long neg_one = (long) -1, const_zero = (
long) 0;
27986 const int is_unsigned = neg_one > const_zero;
27987 #if PY_MAJOR_VERSION < 3
27988 if (likely(PyInt_Check(x))) {
27989 if (
sizeof(
long) <
sizeof(long)) {
27990 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
27992 long val = PyInt_AS_LONG(x);
27993 if (is_unsigned && unlikely(val < 0)) {
27994 goto raise_neg_overflow;
28000 if (likely(PyLong_Check(x))) {
28002 #if CYTHON_USE_PYLONG_INTERNALS
28003 const digit* digits = ((PyLongObject*)x)->ob_digit;
28004 switch (Py_SIZE(x)) {
28005 case 0:
return (
long) 0;
28006 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28008 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28009 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28010 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28011 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28012 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28017 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28018 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28019 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28020 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28021 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28026 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28027 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28028 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28029 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28030 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28036 #if CYTHON_COMPILING_IN_CPYTHON
28037 if (unlikely(Py_SIZE(x) < 0)) {
28038 goto raise_neg_overflow;
28042 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28043 if (unlikely(result < 0))
28045 if (unlikely(result == 1))
28046 goto raise_neg_overflow;
28049 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28050 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28051 #ifdef HAVE_LONG_LONG
28052 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28053 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28057 #if CYTHON_USE_PYLONG_INTERNALS
28058 const digit* digits = ((PyLongObject*)x)->ob_digit;
28059 switch (Py_SIZE(x)) {
28060 case 0:
return (
long) 0;
28061 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28062 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28064 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28065 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28066 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28067 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28068 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28073 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28074 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28075 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28076 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28077 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28082 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28083 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28084 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28085 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28086 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28091 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28092 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28093 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28094 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28095 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28100 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28101 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28102 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28103 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28104 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28109 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28110 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28111 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28112 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28113 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28119 if (
sizeof(
long) <=
sizeof(long)) {
28120 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28121 #ifdef HAVE_LONG_LONG
28122 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28123 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28128 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28129 PyErr_SetString(PyExc_RuntimeError,
28130 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28133 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28134 #if PY_MAJOR_VERSION < 3
28135 if (likely(
v) && !PyLong_Check(
v)) {
28137 v = PyNumber_Long(tmp);
28142 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28143 unsigned char *bytes = (
unsigned char *)&val;
28144 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28145 bytes,
sizeof(val),
28146 is_little, !is_unsigned);
28156 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28157 if (!tmp)
return (
long) -1;
28158 val = __Pyx_PyInt_As_long(tmp);
28163 PyErr_SetString(PyExc_OverflowError,
28164 "value too large to convert to long");
28166 raise_neg_overflow:
28167 PyErr_SetString(PyExc_OverflowError,
28168 "can't convert negative value to long");
28173 #if CYTHON_COMPILING_IN_CPYTHON
28174 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28180 return b == &PyBaseObject_Type;
28182 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28184 if (a == b)
return 1;
28188 n = PyTuple_GET_SIZE(mro);
28189 for (i = 0; i <
n; i++) {
28190 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28195 return __Pyx_InBases(a, b);
28197 #if PY_MAJOR_VERSION == 2
28198 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
28199 PyObject *exception, *value, *tb;
28201 __Pyx_PyThreadState_declare
28202 __Pyx_PyThreadState_assign
28203 __Pyx_ErrFetch(&exception, &value, &tb);
28204 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
28205 if (unlikely(res == -1)) {
28206 PyErr_WriteUnraisable(err);
28210 res = PyObject_IsSubclass(err, exc_type2);
28211 if (unlikely(res == -1)) {
28212 PyErr_WriteUnraisable(err);
28216 __Pyx_ErrRestore(exception, value, tb);
28220 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28221 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
28223 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28228 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28230 assert(PyExceptionClass_Check(exc_type));
28231 n = PyTuple_GET_SIZE(tuple);
28232 #if PY_MAJOR_VERSION >= 3
28233 for (i=0; i<
n; i++) {
28234 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
28237 for (i=0; i<
n; i++) {
28238 PyObject *t = PyTuple_GET_ITEM(tuple, i);
28239 #if PY_MAJOR_VERSION < 3
28240 if (likely(exc_type == t))
return 1;
28242 if (likely(PyExceptionClass_Check(t))) {
28243 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
28249 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28250 if (likely(err == exc_type))
return 1;
28251 if (likely(PyExceptionClass_Check(err))) {
28252 if (likely(PyExceptionClass_Check(exc_type))) {
28253 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28254 }
else if (likely(PyTuple_Check(exc_type))) {
28255 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28259 return PyErr_GivenExceptionMatches(err, exc_type);
28261 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28262 assert(PyExceptionClass_Check(exc_type1));
28263 assert(PyExceptionClass_Check(exc_type2));
28264 if (likely(err == exc_type1 || err == exc_type2))
return 1;
28265 if (likely(PyExceptionClass_Check(err))) {
28266 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28268 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28273 static int __Pyx_check_binary_version(
void) {
28274 char ctversion[4], rtversion[4];
28275 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28276 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28277 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28279 PyOS_snprintf(message,
sizeof(message),
28280 "compiletime version %s of module '%.100s' "
28281 "does not match runtime version %s",
28282 ctversion, __Pyx_MODULE_NAME, rtversion);
28283 return PyErr_WarnEx(NULL, message, 1);
28289 #ifndef __PYX_HAVE_RT_ImportModule
28290 #define __PYX_HAVE_RT_ImportModule
28291 static PyObject *__Pyx_ImportModule(
const char *name) {
28292 PyObject *py_name = 0;
28293 PyObject *py_module = 0;
28294 py_name = __Pyx_PyIdentifier_FromString(name);
28297 py_module = PyImport_Import(py_name);
28298 Py_DECREF(py_name);
28301 Py_XDECREF(py_name);
28307 #ifndef __PYX_HAVE_RT_ImportType
28308 #define __PYX_HAVE_RT_ImportType
28309 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
28310 size_t size,
int strict)
28312 PyObject *py_module = 0;
28313 PyObject *result = 0;
28314 PyObject *py_name = 0;
28316 Py_ssize_t basicsize;
28317 #ifdef Py_LIMITED_API
28318 PyObject *py_basicsize;
28320 py_module = __Pyx_ImportModule(module_name);
28323 py_name = __Pyx_PyIdentifier_FromString(class_name);
28326 result = PyObject_GetAttr(py_module, py_name);
28327 Py_DECREF(py_name);
28329 Py_DECREF(py_module);
28333 if (!PyType_Check(result)) {
28334 PyErr_Format(PyExc_TypeError,
28335 "%.200s.%.200s is not a type object",
28336 module_name, class_name);
28339 #ifndef Py_LIMITED_API
28340 basicsize = ((PyTypeObject *)result)->tp_basicsize;
28342 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
28345 basicsize = PyLong_AsSsize_t(py_basicsize);
28346 Py_DECREF(py_basicsize);
28348 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28351 if (!strict && (
size_t)basicsize > size) {
28352 PyOS_snprintf(warning,
sizeof(warning),
28353 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28354 module_name, class_name, basicsize, size);
28355 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
28357 else if ((
size_t)basicsize != size) {
28358 PyErr_Format(PyExc_ValueError,
28359 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28360 module_name, class_name, basicsize, size);
28363 return (PyTypeObject *)result;
28365 Py_XDECREF(py_module);
28366 Py_XDECREF(result);
28372 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28374 #if PY_MAJOR_VERSION < 3
28375 if (t->is_unicode) {
28376 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28377 }
else if (t->intern) {
28378 *t->p = PyString_InternFromString(t->s);
28380 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28383 if (t->is_unicode | t->is_str) {
28385 *t->p = PyUnicode_InternFromString(t->s);
28386 }
else if (t->encoding) {
28387 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28389 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28392 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28397 if (PyObject_Hash(*t->p) == -1)
28404 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28405 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28407 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28409 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28411 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28412 #if !CYTHON_PEP393_ENABLED
28413 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28415 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28416 if (!defenc)
return NULL;
28417 defenc_c = PyBytes_AS_STRING(defenc);
28418 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28420 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28422 for (
c = defenc_c;
c < end;
c++) {
28423 if ((
unsigned char) (*
c) >= 128) {
28424 PyUnicode_AsASCIIString(o);
28430 *length = PyBytes_GET_SIZE(defenc);
28434 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28435 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28436 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28437 if (likely(PyUnicode_IS_ASCII(o))) {
28438 *length = PyUnicode_GET_LENGTH(o);
28439 return PyUnicode_AsUTF8(o);
28441 PyUnicode_AsASCIIString(o);
28445 return PyUnicode_AsUTF8AndSize(o, length);
28450 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28451 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28453 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28454 __Pyx_sys_getdefaultencoding_not_ascii &&
28456 PyUnicode_Check(o)) {
28457 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28460 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28461 if (PyByteArray_Check(o)) {
28462 *length = PyByteArray_GET_SIZE(o);
28463 return PyByteArray_AS_STRING(o);
28468 int r = PyBytes_AsStringAndSize(o, &result, length);
28469 if (unlikely(
r < 0)) {
28476 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28477 int is_true = x == Py_True;
28478 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28479 else return PyObject_IsTrue(x);
28481 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28482 #if PY_MAJOR_VERSION >= 3
28483 if (PyLong_Check(result)) {
28484 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28485 "__int__ returned non-int (type %.200s). "
28486 "The ability to return an instance of a strict subclass of int "
28487 "is deprecated, and may be removed in a future version of Python.",
28488 Py_TYPE(result)->tp_name)) {
28495 PyErr_Format(PyExc_TypeError,
28496 "__%.4s__ returned non-%.4s (type %.200s)",
28497 type_name, type_name, Py_TYPE(result)->tp_name);
28501 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28502 #if CYTHON_USE_TYPE_SLOTS
28503 PyNumberMethods *m;
28505 const char *name = NULL;
28506 PyObject *res = NULL;
28507 #if PY_MAJOR_VERSION < 3
28508 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28510 if (likely(PyLong_Check(x)))
28512 return __Pyx_NewRef(x);
28513 #if CYTHON_USE_TYPE_SLOTS
28514 m = Py_TYPE(x)->tp_as_number;
28515 #if PY_MAJOR_VERSION < 3
28516 if (m && m->nb_int) {
28518 res = m->nb_int(x);
28520 else if (m && m->nb_long) {
28522 res = m->nb_long(x);
28525 if (likely(m && m->nb_int)) {
28527 res = m->nb_int(x);
28531 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28532 res = PyNumber_Int(x);
28536 #if PY_MAJOR_VERSION < 3
28537 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28539 if (unlikely(!PyLong_CheckExact(res))) {
28541 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28544 else if (!PyErr_Occurred()) {
28545 PyErr_SetString(PyExc_TypeError,
28546 "an integer is required");
28550 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28553 #if PY_MAJOR_VERSION < 3
28554 if (likely(PyInt_CheckExact(b))) {
28555 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28556 return PyInt_AS_LONG(b);
28558 return PyInt_AsSsize_t(x);
28561 if (likely(PyLong_CheckExact(b))) {
28562 #if CYTHON_USE_PYLONG_INTERNALS
28563 const digit* digits = ((PyLongObject*)b)->ob_digit;
28564 const Py_ssize_t size = Py_SIZE(b);
28565 if (likely(__Pyx_sst_abs(size) <= 1)) {
28566 ival = likely(size) ? digits[0] : 0;
28567 if (size == -1) ival = -ival;
28572 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28573 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28577 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28578 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28582 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28583 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28587 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28588 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28592 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28593 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28597 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28598 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28604 return PyLong_AsSsize_t(b);
28606 x = PyNumber_Index(b);
28608 ival = PyInt_AsSsize_t(x);
28612 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28613 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28615 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28616 return PyInt_FromSize_t(ival);